Time Limit: 1000 MS    Memory Limit: 65536 K 


As we know the disk of a computer can be divided into some partitions with label C, D, E and so on. There are many directionaries and files in a partition, and there are many directionaries and file in each directionary and recursive. So we can locate a file or a dictionary as follow: D:\a\b\c\ D:\a\b\c\test.txt where c is a directory and test.txt is a file. When the operation system is linux, there is a directory called root and denoted by "/". We use slash : "/" to seperate directory in linux while that of windows is back-slach : "\" for some business competition. But now windows support both slash and backslash. We use "." to denote current directory and ".." to denote the parent directory of current directory. That's to say D:\a\.\ is equal to D:\a\ D:\a\..\ is equal to D:\ Given a path denoting a directory, your task is to short the path. The filename will contain letters or digitals or spaces.


The first is an integer T stands for the number of test cases. Then T lines follow, and each is a with a path to simplify. constraints: The length of a path in the range of [1, 1000]. The path is a linux-style path. Because we simlify the problem to a path of a directory, the path and the answer always end with "/". The parent directory of root is itself. The path is always valid.


For each test case output the answer in a single line.

Sample Input

3 /usr/bin/ /usr/bin/./ /usr/bin/../

Sample Output

/usr/bin/ /usr/bin/ /usr/