DWITE Online Computer Programming Contest

My First True Letter

October 2009
Problem 4

There are a lot of letters that come and go, but it’s those unique letters that really stand out. And not just any unique letter, but the very first one of such. This is what we want to find in a word.

The input file DATA4.txt will contain 5 lines, each a single word of capital letters, at least 1 and no more than 255 characters long.

The output file OUT4.txt will contain 5 lines, each a single letter – the first (leftmost) letter in the word that is unique to that word.

It is guaranteed for such a letter to exist.

Sample Input (first 3 of 5 shown):
ABC
ABCA
ABCAB
Sample Output (first 3 of 5 shown):
A
B
C