First and Last Letter

No attempts yetTime limit1sMemory limit128 MB

Problem

Write a program that reads a string and prints its first letter followed by its last letter.

Input

The first line contains the number of test cases TT (1T101 \le T \le 10). Each of the next TT lines contains one string. Every string consists only of the uppercase letters A to Z, contains no spaces, and has length less than 1000.

Output

For each test case, print the first letter of the string immediately followed by its last letter, one test case per line. A string of length 1 has the same letter in both positions, so that letter is printed twice.