Ali and Helping innocent people
Practice
3.7 (488 votes)
Basic programming
Easy
Input/output
Problem
92% Success 198718 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

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)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
15 votes
Tags:
EasyMathSorting
Points:50
7 votes
Tags:
ApprovedData StructuresHardImplementationOpenSqrt-DecompositionTreesTries
Points:30
116 votes
Tags:
ApprovedGeometryMediumOpenTwo dimensional