DWITE Online Computer Programming Contest
November 2010
Problem 1
Pattern Matching

Creating a random name generator is not an easy task. There are so many factors to consider, like the origin of the name, the length of the name, etc... In fact, you would also like to know the structure of words used. Here, the 'structure' of a word is the pattern of vowels and consonants. For example, the structure of 'DWITE' would be (consonant, consonant, vowel, consonant, vowel). Given pairs of names generated by the random name generator, determine if the names have the same structure or not.

The input file DATA1.txt will contain 5 lines, each having two strings, separated by a single space, and no more than 256 lowercase letters in length.

The output file OUT1.txt will contain 5 lines of output, the result of comparing the 'structure' of the pair of words. Either same or different.

Note: for the purposes of this question, 'Y' is considered as a consonant.

Sample Input (first 3 shown):
green train
dwite rocks
november canada
		        
Sample Output (first 3 shown):
same
different
different