Submit | All submissions | Best solutions | Back to list |
Problem hidden on 2014-01-11 19:59:28 by Mitch Schwartz
PR003002 - Bionas Flowers Flourish from France |
Biona has always loved poetry, and recently she discovered a fascinating poetical form. Tautograms are a special case of alliteration, which is the occurence of the same letter at the beginning of adjacent words. In particular, a sentence is a tautogram if all of its words start with the same letter.
For instance, the followin sentences are tautograms:
- Flowers Flourish from France
- Sam Simmonds speaks softly
- Peter pIckEd pePPers
- truly tautograms triumph
Biona wants to dazzle her boyfriend with a romantic letter full of this kind of sentences. Please help Biona check if each sentence she wrote down is a tautogram or not.
Input
Each test case is given in a single line that contains a sentence. A sentence consists of a sequence of at most 50 words separated by single spaces. A word is a sequence of at most 20 contiguous uppercase and lowercase letters from the English alphabet. A word contains at least one letter and a sentence contains at least one word.
The last test case is followed by a line containing only a single character '*' (asterisk)
Output
For each test case output a single line containing an uppercase 'Y' if the sentence is a tautogram, or an uppercase 'N' otherwise.
Example
Input: Flowers Flourish from France Sam Simmonds speaks softly Peter pIckEd pePPers truly tautograms triumph this is NOT a tautogram * Output: Y
Y
Y
Y
N
Added by: | kojak_ |
Date: | 2013-11-25 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | 2010 ACM ICPC Latin American Regional Contests |