A deployment tool stores each artifact location as an absolute Unix-style path that always begins with /. The path may contain noise: repeated slashes (// counts the same as a single /), single-dot segments . (the current directory), and double-dot segments .. (the parent directory). Produce the canonical path:
- A single dot segment
.is dropped. - A double dot segment
..removes the previous real directory name, if any; at the root,..has no effect. - Multiple consecutive slashes collapse into one.
Directory names between slashes consist of lowercase letters and digits only (a name is never literally . or .. except when it is one of those special segments).
Input format
A single line: the path. It begins with / and contains no whitespace.
Output format
A single line: the canonical path.
Constraints
- 1 <= length of the path <= 300
- The path begins with
/and uses only/, lowercase letters, digits, and.characters.