//* Problem  : 1067 - Disk Tree
//* Contest  : acm.timus.ru
//* Type     : Solution
//* Date     : 2008.06.01
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 6.0

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <set>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

struct elem{
	map <string, int> mp;
}a[1200000];

int n;
char s[10000];

int pp;

void insert(int v, string s)
{
//	printf("%s\n", s.c_str());
	if (s.empty()) return;
	string t;
	while (s[0] != '\\')
	{
		t.push_back(s[0]);
		s.erase(0, 1);
	}
	s.erase(0, 1);
	int p = a[v].mp[t];
	if (!p)
	{
		a[v].mp[t] = p = ++pp;
	}
	insert(p, s);
}


void print(int v, int d)
{
	vector <string> ss;
	for (map <string, int>::const_iterator it = a[v].mp.begin(); it != a[v].mp.end(); it++)
	{
		ss.push_back(it->first);
	}
	sort(ss.begin(), ss.end());
	for (int i = 0; i < ss.size(); i++)
	{
		for (int j = 0; j < d; j++) putchar(' '); printf("%s\n", ss[i].c_str());
		print(a[v].mp[ss[i]], d + 1);		
	}
}

int main()
{
#ifdef _DEBUG
	freopen("1067", "r", stdin);
#endif
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%s", s);
		string str = s; str += "\\";
		insert(0, str);
	}
	s[0] = 0;
	print(0, 0);
	return 0;
}

