#K37007. Language Detection
Language Detection
Language Detection
In this problem, you are given a list of words and you need to determine which language is predominant: English or French. The words are provided as input, and you must count the occurrences of words from the following sets:
- English words: {(apple, banana, orange, house, car, book)}
- French words: {(pomme, banane, orange, maison, voiture, livre)}
Note that the word orange
is common to both languages and should be counted for each. If the number of English words ((E)) is greater than the number of French words ((F)), output "English". If (F > E), output "French". If (E = F) (including when the list is empty or when none of the words belong to these sets), output "Tie".
Your program should read from standard input and write to standard output.
inputFormat
The input consists of two lines:
- The first line contains a single integer (n) ( (0 \leq n \leq 10^5)), representing the number of words.
- The second line contains (n) words separated by spaces.
outputFormat
Output a single line: English
if there are more English words, French
if there are more French words, or Tie
if both counts are equal.## sample
5
apple orange house book car
English