All Submissions


Problem Statement :
Screw the long story lines, lets cut to the chase. Given a list of E-Mail addresses, you need to check if each of them is valid or not. An E-Mail address consists of two parts : the local part of an address (before the @ sign) and the domain part (after the @ sign). Now each of these parts follow their own conventions. To simply the validation, let us assume that these are the only conventions that we need to follow.

Local Part :
  • Can contain upper/lower case English letters and digits
  • The only symbols allowed are : dots('.'), hyphens('-') and underscores('_')
  • Must not begin or end with one of the above mentioned symbols
  • The dot symbol('.') cannot appear more than once consecutively

Domain Part (Syntax):
  • The top-level domain must consist of at least 2 characters, which are English letters only
  • There can be nested sub-domains, (separated by dots ('.')), each of which can contain upper/lower case English letters, digits and hyphens('-'), taking care that it does not begin or end with a symbol
  • Needless to say, the dot symbol('.') cannot appear more than once consecutively in the sub-domain

Input :
Consists of multiple lines, each containing an E-Mail address. Read till EOF.

Output :
For each test case, print out 'Valid' or 'Invalid' after parsing the input string.

Sample Input :

cat@hack.wa
-cat-@hacky.com
cute-kitten@hacky.com
cute.kitten@hacky.com
cute..kitten@hacky.com
cat@hack.y
c4t@h4ck.root.com


Sample Output :

Valid
Invalid
Valid
Valid
Invalid
Invalid
Valid


Problem Setter : Vishnu Mohandas


Languages: C#,JavaScript,Pascal,Perl,PHP,Python,Ruby

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0