Company: Visa_5sep
Difficulty: easy
Simulate CD Command A tiny shell keeps track of one current working directory . When the shell starts, the current working directory is the root, written / . You are given n commands, executed in the order given. Every command is cd followed by a single space and one argument: cd / — go to the root directory. cd . — stay where you are. cd .. — go one level up. At the root this does nothing. cd <name> — go into the subdirectory <name> of the current working directory . <name> consists of lowercase English letters only, and the directory is guaranteed to exist. Print the absolute path of the working directory after all n commands have run, using / as the separator between names. The root itself is printed as / . Input Format The first line contains one integer n — the number of commands. Each of the next n lines contains one command in the form cd <argument> . Output Format Print a single line: the absolute path of the final working directory. It starts with / and