#!/usr/bin/python3

import sys
import random

RootPrefix="•"
Vertical="│"
LeafWithOther="├"
SingleLeaf="└"
WithChildren="┬"
WithoutChildren="─"

class Node:
    def __init__(self, name):
        self.name = name
        self.parent = None
        self.children = set()
        
    def set_parent(self, parent):
        if self.parent != None:
            self.parent.children.remove(self)
        self.parent = parent
        self.parent.children.add(self)

    def print_indentation(self, prefix):
        sys.stdout.write(prefix + self.name + '\n')
        for c in self.children:
            c.print_indentation(prefix + '  ')

    def print_simple(self, prefix):
        sys.stdout.write(prefix[0:-1] + '+-' + self.name + '\n')
        l = list(self.children)
        for i in range(0, len(l)):
            if i < len(l) - 1:
                l[i].print_simple(prefix + ' |')
            else:
                l[i].print_simple(prefix + '  ')

    def print_pretty(self, prefix, prefix2):
        l = list(self.children)
        if len(l) == 0:
            sys.stdout.write(prefix + prefix2 + WithoutChildren + self.name + '\n')
        else:
            sys.stdout.write(prefix + prefix2 + WithChildren + self.name + '\n')

        if prefix2 == LeafWithOther:
            new_prefix = prefix + Vertical 
        else:
            new_prefix = prefix + ' '
        for i in range(0, len(l)-1):
            l[i].print_pretty(new_prefix, LeafWithOther)
        if (len(l) > 0):
            l[-1].print_pretty(new_prefix, SingleLeaf)

    def print_tree(self, format):
        if format == 'indentation':
            self.print_indentation('')
        elif format == 'simple':
            self.print_simple('')
        else:
            self.print_pretty('', RootPrefix)

def read_tree_from_child_parent_list():
    nodes = {}
    roots = Node("")
    for line in sys.stdin:
        child_name, parent_name = line.split()
        if parent_name not in nodes:
            parent = Node(parent_name)
            nodes[parent_name] = parent
            parent.set_parent(roots)
        else:
            parent = nodes[parent_name]
            
        if child_name not in nodes:
            child = Node(child_name)
            nodes[child_name] = child
        else:
            child = nodes[child_name]

        child.set_parent(parent)
    return roots

def read_file_system_tree():
    nodes = {}
    roots = Node("")
    for child_name in sys.stdin:
        child_name = child_name.rstrip('\n')
        parent_name, separator, basename = child_name.rpartition('/')

#        print(child_name + '(' + basename + ') -> ' + parent_name)

        if parent_name not in nodes:
            parent_basename = parent_name.rpartition('/')[2]
            parent = Node(parent_basename)
            nodes[parent_name] = parent
            parent.set_parent(roots)
        else:
            parent = nodes[parent_name]
            
        if child_name not in nodes:
            child = Node(basename)
            nodes[child_name] = child
        else:
            child = nodes[line]

        child.set_parent(parent)
    return roots

# R = read_tree_from_child_parent_list()
R = read_file_system_tree()

formats = sys.argv[1:]
if formats == []:
    formats = [ 'indentation', 'simple', 'pretty' ]

for f in formats:
    for r in R.children:
        r.print_tree(f)

