10613 - Filesystem   

Description

We are going to compare two directories in this problem.

Files

All files in this problem are empty files, so all files are identical.

Directories

Directories are containers for files and other directories.

Two directories are considered identical if everything found in one directory exists and is identical to the one with the same name in the other directory.

Input

  • positive integer N at the first line
  • N lines of path
  • positivge integer M
  • M lines of path path

 

paths

  • /a and /A are different paths
  • the slash / is used in problem as the separator
  • paths always starts with a slash /
  • if a path ends with a slash /\ , it indicates the last object in the path is a directory, otherwise it is a file.

For example, /a/example/of/path should be intepreted as:

create a directory named "a" in the root directory "/" if it does not exist
create a directory named "example" in "/a/" if it does not exist
create a directory named "of" in "/a/example/" if it does not exist
create a empty file named "path" in "/a/example/of/"

And

a/b/c/d/
a/b/e/f/
a/b/e/g

would give us:

a/
└── b/
    ├── c/
    │   └── d/
    └── e/
        ├── f/
        └── g

Output

M lines, each line contains a character i or d indicating either the two paths' content is identical or different.

Sample Input  Download

Sample Output  Download

Tags




Discuss