<center> 4081.   God Le wants to know the directory
Time Limit: 1.0 Seconds    Memory Limit:65536K
Total Runs: 394    Accepted Runs:135 </center>


God Le is the most talented ACMer in the TJU-ACM team.
When he wants to open a file,he can just use his keyboard instead of using his mouse to click.
Why he can do this?Because he uses the cmd.exe. There are many commands in cmd.exe.But God Le is kind of lazy,so he just uses three commands to change the current directory.
"cd dir"(without quotes):put you in a subdirectory.For example,if you are in C:\Programs,typing cd Vim will put you in C:\Programs\Vim.
"Disk(like C,D,etc):"(without quotes):put you in the directory in that Disk that you are in most recently.For example,if you are in C:\Programs,typing D: and C: will put you in C:\Programs.(at the beginning,when you type Disk:,you will be in Disk:\).
"cd .."(without quotes):move you up one directory.So,if you are in C:\Programs\Vim,cd .. moves you to C:\Programs.
Because God Le is very smart,he won't go to the directory that is not existed. Now,given a sequence of commands,God Le wants to know the current directory.
One thing that you should know is that God Le's computer only have four disks C,D,E,F.
HINT I:The initial directory is C:\users\godle
HINT II:every subdirectory is only a string contains no more than 10 lower-case letters.

Input

There are mulit cases.Each case begins with an integer m(1 ≤ m ≤ 10^3)means the operations.Next there are m lines.Each line contains a command.

Output

For each command,print the current directory.You can get more hints from the sample.

Sample Input

5
cd ..
D:
cd ..
cd abc
C:

Sample Output

C:\users
D:
D:
D:\abc
C:\users


大模拟  很烦写大模拟。。不好写

#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<map>
using namespace std;
map<string,int>dui;
typedef struct node
{
    string name;
    int id;
}node ;
string lie[4][10005];
int cnt[4];
vector<node>arr[10005];
int main()
{
    int i,j;
    int T;
    while(scanf("%d",&T)!=EOF)
    {
        dui.clear();
        for(i=0;i<10005;i++)arr[i].clear();
        memset(cnt,0,sizeof(cnt));
        int cur=0;
        cnt[0]=2;
        lie[0][0]="users";
        lie[0][1]="godle";
        while(T--)
        {
            string a,b;
            cin>>a;
            if(a=="cd")
            {
                cin>>b;
                if(b=="..")
                {
                    cnt[cur]--;
                    cnt[cur]=max(cnt[cur],0);
                }
                else
                {
                    lie[cur][cnt[cur]++]=b;
                }
            }
            else if(a[0]>='C'&&a[0]<='F')
            {
                int pos=a[0]-'C';
                cur=pos;
            }
            char tmp='C'+cur;
            cout<<tmp<<":";
            for(i=0;i<cnt[cur];i++)
            {
                cout<<"\\"<<lie[cur][i];
            }
            cout<<endl;
        }
    }
}