This page is still under construction.

Parts of this page are still being built. What you see may change.

First and Last Letter

Interview

Time limit1sMemory limit128 MB

Summary
Print the first and last letter of each given uppercase string, doubling the letter for length 1.
Level

Easy1 of 10

Topics
String
Solved
No attempts yet

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 (1≤T≤101 \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.

Examples1

  1. Example 1

    Input
    3
    ACDKJFOWIEGHE
    O
    AB
    
    Expected output
    AE
    OO
    AB