#C1277. Alternating Case Transformation

    ID: 42233 Type: Default 1000ms 256MiB

Alternating Case Transformation

Alternating Case Transformation

This problem requires you to transform a given string by alternating the case of each letter. The first encountered alphabetical character should be converted to lowercase, the next alphabetical character to uppercase, the following one to lowercase, and so on. Non-letter characters should remain unchanged and do not affect the alternation order.

For example:

  • If the input is hello, the output should be hElLo.
  • If the input is 1a2b3C, the output should be 1a2B3c.

You are required to read a string from standard input and output the transformed string to standard output. All input will be given via stdin and the answer must be printed to stdout.

inputFormat

A single line containing a string s which may include letters, digits, and other printable characters.

Note: The string can be empty.

outputFormat

A single line containing the transformed string where letters have alternating cases starting with lowercase for the first encountered alphabetical character.

## sample
hello
hElLo