All problems

Country Code Chaos

mediumPythonData CleaningStringsDictionaries

Ardenne Logistics files customs paperwork by destination country, and its country column has been typed by hand for years. The United States turns up as us, as USA, as U.S. and as united states, and all four mean the same destination. Every other country is left as whoever typed it wrote it, except that the whole column is put into capitals so it reads consistently.

Task: Print the normalised country for each value.

Input

The first line holds one integer n, how many country values follow. Each of the next n lines holds one country exactly as it was typed. A value may contain full stops and may use any mixture of upper and lower case.

Output

n lines in the same order. A value that is one of the four spellings of the United States — ignoring full stops and capitalisation — prints as US. Every other value prints as it arrived, converted to capitals.

Example:

Input:
4
us
U.S.
united states
france

Output:
US
US
US
FRANCE

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…