The Path Tree

Ruben accidentally lost all the information from his workstation's hard drive, including the directory structure he had created over the years. While he doesn't care about the files themselves, he values the directory structure and wants to restore it. Luckily, he has several copies of directory listings from his hard drive, which contain the full paths of some directories.
Your task is to help Bill restore his directory structure by providing a nicely formatted directory tree.

Input

The first line contains an integer n, representing the total number of distinct directory paths (1 ≀ n ≀ 500).
The following n lines contain the directory paths, one per line. Each path does not contain leading or trailing spaces and is limited to a maximum of 80 characters. The directory names in each path are separated by a backslash (/).
Each directory name consists of 1 to 8 uppercase letters, numbers, or special characters: exclamation mark, number sign, dollar sign, percent sign, ampersand, apostrophe, opening and closing parenthesis, hyphen sign, commercial at, circumflex accent, underscore, grave accent, opening and closing curly bracket, and tilde (!#$%&'()-@^_`{}~).

Output

  • Each directory name should be listed on its own line, preceded by a number of spaces that indicate its depth in the directory hierarchy.
  • Subdirectories should be listed immediately after their parent directories, indented by one additional space.
  • Top-level directories should have no spaces printed before their names.
  • All directories should be listed in lexicographic order.

Examples

Input
Output
7 WINNT/SYSTEM32/CONFIG GAMES WINNT/DRIVERS HOME WIN/SOFT GAMES/DRIVERS WINNT/SYSTEM32/CERTSRV/CERTCO~1/X8O~1\X86
GAMES DRIVERS HOME WIN SOFT WINNT DRIVERS SYSTEM32 CERTSRV CERTCO~1 X86 CONFIG
Β 

Constraints

Time limit: 5 seconds

Memory limit: 512 MB

Output limit: 10 MB

To check your solution you need to sign in
Sign in to continue