Speed Programming (Round II)
Problem # 1
You have been given a String S consisting of uppercase and lowercase English alphabets. You need to
change the case of each alphabet in this String. That is, all the uppercase letters should be converted
to lowercase and all the lowercase letters should be converted to uppercase. You need to then print
the resultant String to output.
Input Format
The first and only line of input contains the String S
Constraints
1≤|S|≤100 where S denotes the length of string S.
Output Format
Print the resultant String on a single line.
Problem # 2
Arpasland has surrounded by attackers. A truck enters the city. The driver claims the load is food and
medicine from Iranians. Ali is one of the soldiers in Arpasland. He doubts about the truck, maybe it's
from the siege. He knows that a tag is valid if the sum of every two consecutive digits of it is even
and its letter is not a vowel. Determine if the tag of the truck is valid or not.
We consider the letters "A","E","I","O","U","Y" to be vowels for this problem.
Input Format
The first line contains a string of length 9. The format is "DDXDDD-DD", where D stands for a digit
(non zero) and X is an uppercase English letter.
Output Format
Print "valid" (without quotes) if the tag is valid, print "invalid" otherwise (without quotes)