WC '18 Contest 1 J2 - Making the Cut

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 16M

Author:
Problem type
Woburn Challenge 2018-19 Round 1 - Junior Division

The computer science club at H.S. High School has just posted a special list of five student names. These students have qualified to represent the school at an upcoming programming competition, hosted by Ontario's Organization for Computing Education (OOCE)! The i-th name on this team roster is S_{i}, a non-empty string consisting of at most 20 lowercase letters (a...z), and all five names are distinct.

A certain student is looking at this team roster, and wants to see whether or not they made the cut and will get to compete. This student's name is N, which is similarly a non-empty string consisting of at most 20 lowercase letters. Unfortunately, though their programming skills are strong, their reading skills aren't so strong, so they're having trouble looking for their name on the list. Help them determine whether or not any of the five names S_{1\ldots5} on the team rosters are equal to their own name N. Output Y if their name is present, or N if it isn't.

Input Specification

The first line of input consists of a single string, N.
Five lines follow, the i-th of which consists of a single string, S_{i}, for i = 1\ldots 5.

Output Specification

Output a single character, either Y if any of the five names on the team roster are equal to N, or N otherwise.

Sample Input 1

bob
alice
bob
christine
david
erika

Sample Output 1

Y

Sample Input 2

alice
frank
georgia
hans
ilia
james

Sample Output 2

N

Sample Explanation

In the first case, bob is the second of the five names on the team roster.

In the second case, alice is not present on the team roster.


Comments

There are no comments at the moment.