Name Cutter

2

2 votes
Problem

pooja works in a govt. office where she manages the database of different people who comes there to solve their queries , so simply what she do is , she stores the person information in his database , but due to programmer mistake the database software has got a simple error is that it cannot store a long name so pooja's work is to short the name and store in her database.

Constraints

1<T<=10
1<name<=100

Input :

First line of input contains the number of test cases(T). Next each of T lines contains a name(char string).

Output :

You have to print the single small case shorted name for each test case.

Note :

  1. All name input will be in small case.
  2. use a blank space after every . (dot)
Sample Input
3
akhilesh kumar gupta
kumar
vicky sharma
Sample Output
a. k. gupta
kumar
v. sharma
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Case 1 : akhilesh kumar gupta - a. k. gupta here there are three words so we can short first two words.

Case 2 : kumar - kumar here only single word name is given , so no need to short it.

Case 3 : vicky sharma - v. sharma here there are only two words so we can only short the first word.

Editor Image

?