#C6037. Generate Secure Password

    ID: 49753 Type: Default 1000ms 256MiB

Generate Secure Password

Generate Secure Password

You are given a string and your task is to generate a secure password according to the rules of Zedonia. The rules are as follows:

  • If the string consists solely of lowercase letters, output the reverse of the string.
  • If the string consists solely of uppercase letters, output the string converted to lowercase.
  • If the string consists solely of digits, output the sum of all digits. In other words, if the digits are \(d_1, d_2, \dots, d_n\), then output \(\sum_{i=1}^{n} d_i\).
  • If the string consists solely of alphabetic characters but is neither all lowercase nor all uppercase (i.e. mixed case), output the string with each letter’s case swapped.
  • For any other mix of characters, the output should be INVALID.

Make sure to follow these rules exactly!

inputFormat

The input consists of a single line string s (1 ≤ |s| ≤ 1000) which can contain alphabets (both uppercase and lowercase) and digits. No extra spaces or lines are included in the input.

outputFormat

Output a single string that is the secure password generated according to the rules described above. Output exactly what is expected without any additional characters or whitespace.

## sample
hello
olleh