Time Limit: Java: 2000 ms / Others: 2000 ms
Memory Limit: Java: 65536 KB / Others: 65536 KB
There are multiple test cases. The first line of input is an integer T ≈ 1000 indicating the number of test cases.
Each test case consists of a cardinal number 0 ≤ n < 1,000,000,000.
1st 2nd 3rd 4th 1024th References http://en.wikipedia.org/wiki/Names_of_numbers_in_English http://en.wikipedia.org/wiki/Ordinal_number_(linguistics)