Let's define a string <x> as an opening tag, where x is any small letter of the Latin alphabet. Each opening tag matches a closing tag of the type </x>, where x is the same letter.

Tegs can be nested into each other: in this case one opening and closing tag pair is located inside another pair.

Let's define the notion of a XML-text: 

  * an empty string is a XML-text
  * if s is a XML-text, then s'=<a>+s+</a> also is a XML-text, where a is any small Latin letter 
  * if s1, s2 are XML-texts, then s1+s2 also is a XML-text



You are given a XML-text (it is guaranteed that the text is valid), your task is to print in the following form: 

  * each tag (opening and closing) is located on a single line 
  * print before the tag 2 * h spaces, where h is the level of the tag's nestedness. 

Input

The input data consists on the only non-empty string — the XML-text, its length does not exceed 1000 characters. It is guaranteed that the text is valid. The text contains no spaces.

Output

Print the given XML-text according to the above-given rules.

Examples

Input

&lt;a&gt;&lt;b&gt;&lt;c&gt;&lt;/c&gt;&lt;/b&gt;&lt;/a&gt;


Output

&lt;a&gt;
  &lt;b&gt;
    &lt;c&gt;
    &lt;/c&gt;
  &lt;/b&gt;
&lt;/a&gt;


Input

&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;d&gt;&lt;c&gt;&lt;/c&gt;&lt;/d&gt;&lt;/a&gt;


Output

&lt;a&gt;
  &lt;b&gt;
  &lt;/b&gt;
  &lt;d&gt;
    &lt;c&gt;
    &lt;/c&gt;
  &lt;/d&gt;
&lt;/a&gt;

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
s = input()
h = 0
l = s.split('>')
for _ in range(len(l)):
	l[_] += '>'
l = l[:-1]
for i in range(len(l)):
	if '/' in l[i]:
		h -= 2
	print(h * ' ' + l[i])
	if '/' not in l[i]:
		h += 2


s = input()
(lv, pad, nst, a) = (0, -1, 1, list())
for i in range(len(s)):
	if s[i] == '<':
		pad += nst
		nst = 1
	elif s[i] == '/':
		pad -= 1
		nst = 0
	elif s[i] == '>':
		a.append(' ' * (2 * pad) + s[lv:i + 1])
		lv = i + 1
for i in a:
	print(i)


xml = input()
n = len(xml)
op = 0
i = 0
memDict = {}
while i < n - 3:
	poss = xml[i:i + 3]
	if poss[2] == '>':
		res = ' ' * op + poss
		op += 2
		i += 3
		print(res)
	else:
		poss = xml[i:i + 4]
		op -= 2
		res = ' ' * op + poss
		i += 4
		print(res)


import math
for m in range(1, 2):
	s = str(input())
	curr = []
	i = 0
	j = 0
	for j in range(len(s) * 2):
		if i >= len(s):
			break
		if '/' in s[i:i + 3 + 1]:
			if s[i + 2] in curr:
				curr.reverse()
				index1 = curr.index(s[i + 2])
				index1 = len(curr) - index1 - 1
				print(index1 * '  ' + s[i:i + 3 + 1])
				curr.remove(s[i + 2])
				curr.reverse()
				i += 4
		else:
			if s[i + 1] in curr:
				curr.append(s[i + 1])
				curr.reverse()
				index1 = curr.index(s[i + 1])
				index1 = len(curr) - index1 - 1
				print(index1 * '  ' + s[i:i + 3])
				curr.reverse()
				i += 3
				continue
			curr.append(s[i + 1])
			index1 = curr.index(s[i + 1])
			print(index1 * '  ' + s[i:i + 3])
			i += 3


h = 0
for tag in input().replace('><', '> <').split():
	if '/' in tag:
		h -= 2
	print(h * ' ' + tag)
	if '/' not in tag:
		h += 2


s = input()
s = s.split('<')
h = 0
for x in s[1:]:
	if x[0] != '/':
		tab = h * 2 * ' '
		print(tab + '<' + x)
		h += 1
	else:
		h -= 1
		tab = h * 2 * ' '
		print(tab + '<' + x)


s = input()
s = s.replace('>', '<')
s = s.split('<')
cur = 0
for e in s:
	if e == '':
		continue
	sp = '  '
	if e.count('/'):
		cur -= 1
	ans = cur * sp
	ans += '<' + e + '>'
	print(ans)
	if not e.count('/'):
		cur += 1


def f(x, s):
	if x == len(a):
		return
	if '/' in a[x]:
		print(' ' * 2 * (s - 1) + a[x])
		f(x + 1, s - 1)
	else:
		print(' ' * 2 * s + a[x])
		f(x + 1, s + 1)
a = [x + '>' for x in input().split('>')]
a = a[0:len(a) - 1]
f(0, 0)


str = input()
s = []
level = 0
prev = '0'
for i in range(len(str)):
	c = str[i]
	if c != '<' and c != '>' and (c != '/'):
		if prev == '<':
			print(' ' * (2 * level) + '<' + c + '>')
			level += 1
		else:
			level -= 1
			print(' ' * (2 * level) + '</' + c + '>')
	prev = c


text = input().strip()
visited = []
spacing_level = 0
for i in range(len(text)):
	letter = text[i]
	if letter in '</>':
		continue
	if text[i - 1] == '/':
		spacing_level -= 1
		print('  ' * spacing_level + '</' + letter + '>')
	else:
		print('  ' * spacing_level + '<' + letter + '>')
		spacing_level += 1


s = input()
s = ''.join(s.split('>'))
s = ''.join(s.split('<'))
a = []
i = 0
tab = 0
ws = ' '
while i < len(s):
	if s[i] != '/':
		a.append(ws * tab + '<' + s[i] + '>')
		tab += 2
		i += 1
	if s[i] == '/':
		tab -= 2
		a.append(ws * tab + '</' + s[i + 1] + '>')
		i += 2
for i in a:
	print(i)


n = input()
ls = []
i = 0
while i < len(n):
	if n[i] == '<':
		p = ''
		j = i
		while n[j] != '>':
			p += n[j]
			j += 1
		p += '>'
		ls.append(p)
	i += 1
k = 0
i = 0
while i < len(ls):
	count = 0
	anticount = 0
	if ls[i].replace(' ', '')[1] == '/':
		i += 1
		continue
	else:
		j = i + 1
		while j < len(ls) and count - anticount >= 0:
			if ls[j].replace(' ', '') == ls[i].replace(' ', ''):
				count += 1
			elif ls[j].replace(' ', '').replace('<', '') == '/' + ls[i].replace(' ', '').replace('<', ''):
				anticount += 1
			j += 1
		j = i + 1
		while j < len(ls) and ls[j].replace(' ', '').replace('<', '') != '/' + ls[i].replace(' ', '').replace('<', '') or count != 0:
			if ls[j].replace(' ', '').replace('<', '') == '/' + ls[i].replace(' ', '').replace('<', ''):
				if count > 0:
					count -= 1
			ls[j] = ' ' * 2 + ls[j]
			j += 1
	i += 1
for i in ls:
	print(i)


from bisect import insort, bisect_right, bisect_left
from sys import stdout, stdin, setrecursionlimit
from heapq import heappush, heappop, heapify
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from string import *
from queue import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
(graph, mod, szzz) = ({}, 10 ** 9 + 7, lambda : sorted(zzz()))

def getStr():
	return input()

def getInt():
	return int(input())

def listStr():
	return list(input())

def getStrs():
	return input().split()

def isInt(s):
	return '0' <= s[0] <= '9'

def input():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in input().split()]

def output(answer, end='\n'):
	stdout.write(str(answer) + end)

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def getPrimes(N=10 ** 5):
	SN = int(sqrt(N))
	sieve = [i for i in range(N + 1)]
	sieve[1] = 0
	for i in sieve:
		if i > SN:
			break
		if i == 0:
			continue
		for j in range(2 * i, N + 1, i):
			sieve[j] = 0
	prime = [i for i in range(N + 1) if sieve[i] != 0]
	return prime

def primeFactor(n, prime=getPrimes()):
	lst = []
	mx = int(sqrt(n)) + 1
	for i in prime:
		if i > mx:
			break
		while n % i == 0:
			lst.append(i)
			n //= i
	if n > 1:
		lst.append(n)
	return lst
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
daysInMounth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
lst = getStr()
arr = []
ch = ''
for i in lst:
	if i == '>':
		arr.append(ch + '>')
		ch = ''
	else:
		ch += i
que = deque()
for i in arr:
	if i[:2] == '</':
		x = que.pop()
		sp = ' ' * (2 * len(que))
		print(sp + '</' + x[1:])
	else:
		sp = ' ' * (2 * len(que))
		print(sp + i)
		que.append(i)


s = input()
data = []
temp = ''
for z in range(len(s)):
	temp += s[z]
	if s[z] == '>':
		data.append(temp)
		temp = ''
space = 0
for z in range(len(data)):
	if z == 0:
		print('  ' * space, end='')
		print(data[z])
	elif data[z][1] == '/':
		print('  ' * space, end='')
		print(data[z])
		space -= 1
	else:
		space += 1
		print('  ' * space, end='')
		print(data[z])


xml = input()
tags = xml.split('>')[:-1]
for i in range(len(tags)):
	tags[i] += '>'
h = 0
for tag in tags:
	if '</' not in tag:
		print(' ' * 2 * h + tag)
		h += 1
	else:
		h -= 1
		print(' ' * 2 * h + tag)


s = input()

def pnt(i, c):
	if i < len(s):
		if s[i + 1] == '/':
			c -= 2
			print(' ' * c + s[i:i + 4])
			pnt(i + 4, c)
		else:
			print(' ' * c + s[i:i + 3])
			pnt(i + 3, c + 2)
pnt(0, 0)


z = input()
z = z.split('<')
i = 1
c = 0
while i < len(z) - 1:
	print(' ' * 2 * c + '<' + z[i])
	if z[i][0] != z[i + 1][0] and z[i][0] != '/' and (z[i + 1][0] != '/'):
		c = c + 1
	elif z[i][0] != z[i + 1][0] and z[i][0] == '/' and (z[i + 1][0] != '/'):
		pass
	elif z[i][0] == z[i + 1][0] and z[i][0] == '/':
		c = c - 1
	elif not z[i] == z[i + 1][1:]:
		c = c + 1
	i = i + 1
print('<' + z[-1])


s = input()
(i, spaces) = (0, 0)
while i < len(s):
	if s[i + 1] != '/':
		print(' ' * spaces + s[i:i + 3])
		spaces += 2
		i += 3
	else:
		spaces -= 2
		print(' ' * spaces + s[i:i + 4])
		i += 4


from collections import deque, defaultdict, Counter
from itertools import product, groupby, permutations, combinations
from math import gcd, floor, inf, log2, sqrt, log10
from bisect import bisect_right, bisect_left
from statistics import mode
from string import ascii_uppercase
s = input()
stack = ''
prev = None
i = 0
for char in s:
	if stack and char == '<':
		if not prev:
			print(stack)
			prev = stack
			stack = ''
		else:
			if '/' not in prev and '/' in stack:
				i -= 0
			elif '/' in prev and '/' not in stack:
				i -= 0
			elif '/' in prev and '/' in stack:
				i -= 1
			else:
				i += 1
			print(i * 2 * ' ' + stack)
			prev = stack
			stack = ''
	stack += char
print(stack)


import sys
s = sys.stdin.readline().strip()

def toFormatedXML(s):
	s = s.split('>')
	del s[-1]
	spaces = 0
	for tag in s:
		if tag[1] == '/':
			spaces -= 2
			print(' ' * spaces + tag + '>')
		else:
			print(' ' * spaces + tag + '>')
			spaces += 2
toFormatedXML(s)


s = input()
s1 = s.split('<')
del s1[0]
c = 0
for i in s1:
	if '/' in i:
		print('  ' * (c - 1), '<', i, sep='')
		c -= 1
	else:
		print('  ' * c, '<', i, sep='')
		c += 1


import re
s = input().strip()
tags = re.findall('</?\\w>', s)
depth = 0
for tag in tags:
	if '/' in tag:
		depth -= 1
	print('%s%s' % (depth * '  ', tag))
	if '/' not in tag:
		depth += 1


def solve(text):
	opening_index = 0
	res = list()
	curr_level = 0
	spaces = ['  ' * i for i in range(300)]
	while opening_index < len(text):
		closing_index = text.index('>', opening_index)
		if text[opening_index + 1] == '/':
			curr_level -= 1
			res.append(spaces[curr_level] + text[opening_index:closing_index + 1])
		else:
			res.append(spaces[curr_level] + text[opening_index:closing_index + 1])
			curr_level += 1
		opening_index = closing_index + 1
	print('\n'.join(res))
text = input()
solve(text)


spacecnt = 0
for tag in input().split('>')[:-1]:
	if tag.find('/') != -1:
		spacecnt -= 2
		print(' ' * spacecnt + tag + '>')
	else:
		print(' ' * spacecnt + tag + '>')
		spacecnt += 2


s = [str(j) for j in input().split('>')]
space = 0
for j in range(len(s) - 1):
	if s[j][1] == '/':
		print(end=(space - 2) * ' ')
		print(end=s[j] + '>')
		space -= 2
	else:
		print(end=space * ' ')
		print(end=s[j] + '>')
		space += 2
	print()


str_input = input()
queue = []
indentation = 0
while str_input != '':
	if str_input[1] == '/':
		print('%s%s' % (indentation * ' ', str_input[0:4]))
		queue.pop()
		str_input = str_input[4:]
		if str_input != '' and str_input[1] == '/':
			indentation -= 2
	else:
		print('%s%s' % (indentation * ' ', str_input[0:3]))
		queue.append(str_input[1:2])
		str_input = str_input[3:]
		if str_input != '' and str_input[0:3] != '</%s' % queue[-1]:
			indentation += 2


(s, c) = ([], False)
for ch in input().replace('<', '').replace('>', ''):
	if ch.isalpha():
		if c:
			s.pop()
			print('  ' * len(s) + '</' + ch + '>')
			c = False
		else:
			print('  ' * len(s) + '<' + ch + '>')
			s += ch
	else:
		c = True


import time
xml_text = input()
indent = 0
i = 0
while i < len(xml_text):
	tmp = ''
	closing = False
	start_index = i
	while i == start_index or xml_text[i - 1] != '>':
		tmp += xml_text[i]
		if xml_text[i] == '/':
			closing = True
		i += 1
	if closing:
		indent -= 1
		print(' ' * (2 * indent) + tmp)
	else:
		print(' ' * (2 * indent) + tmp)
		indent += 1


s = input()
h = int(0)
xml = dict()
for i in range(len(s)):
	if s[i] == '<' and s[i + 1] != '/':
		print(' ' * 2 * h + s[i:i + 3])
		h += 1
	elif s[i] == '<' and s[i + 1] == '/':
		h -= 1
		print(' ' * 2 * h + s[i:i + 4])


from sys import stdin, stdout
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007

def solve():
	s = input().split('<')
	s = ''.join(s)
	s = s.split('>')
	s.pop()
	h = [(s[0], 0)]
	for i in s:
		if len(i) == 2:
			if i[1] == h[-1][0]:
				print(' ' * 2 * (h[-1][1] - 1) + '<' + i + '>')
				h.pop()
			else:
				h.append((i, h[-1][1] + 1))
		else:
			h.append((i, h[-1][1] + 1))
			print(' ' * 2 * (h[-1][1] - 1) + '<' + h[-1][0] + '>')
for _ in range(1):
	solve()


def solve(text):
	opening_index = 0
	res = list()
	curr_level = 0
	while opening_index < len(text):
		closing_index = text.index('>', opening_index)
		if text[opening_index + 1] == '/':
			curr_level -= 1
			res.append('  ' * curr_level + text[opening_index:closing_index + 1])
		else:
			res.append('  ' * curr_level + text[opening_index:closing_index + 1])
			curr_level += 1
		opening_index = closing_index + 1
	print('\n'.join(res))
text = input()
solve(text)


a = input().replace('><', '> <').split()
c = 0
for i in a:
	if len(i) == 3:
		print(c * 2 * ' ' + i)
		c += 1
	else:
		c -= 1
		print(c * 2 * ' ' + i)


s = input().replace('>', '>,').split(',')
cnt = 0
x = 1
for i in range(len(s) - 1):
	print(' ' * 2 * cnt + s[i])
	if s[i].count('/') == 0 and s[i + 1].count('/') == 0:
		cnt += 1
	elif s[i].count('/') == 1 and s[i + 1].count('/') == 1:
		cnt -= 1


c = 0
for x in input().replace('<', ' ').replace('>', ' ').split():
	if x[0] == '/':
		c -= 1
	print(c * '  ', end='')
	if x[0] == '/':
		print('</' + x[1] + '>')
	else:
		c += 1
		print('<' + x[0] + '>')


s = input().split('>')
pad = -1
for c in s:
	if not len(c):
		continue
	if c[1] == '/':
		print(' ' * (2 * pad) + c + '>')
		pad -= 1
	else:
		pad += 1
		print(' ' * (2 * pad) + c + '>')


s = input()
stack = []
open = True
for (i, c) in enumerate(s):
	if c == '>':
		continue
	if c == '<':
		open = True
	elif c == '/':
		open = False
	elif open:
		stack.append(c)
		print('  ' * (len(stack) - 1), end='')
		print('<' + c + '>')
	else:
		print('  ' * (len(stack) - 1), end='')
		print('</' + c + '>')
		stack.pop()


a = input().split('>')
bal = 0
for s in a:
	if len(s) == 0:
		continue
	if s[1] == '/':
		bal -= 1
		print(bal * '  ' + s + '>')
	else:
		print(bal * '  ' + s + '>')
		bal += 1


qwq = input().replace('><', '> <').split()
c = 0
for i in qwq:
	k = 2 * c
	s = 2 * (c - 1)
	q = len(i)
	if q == 3:
		print(k * ' ' + i)
		c = c + 1
	else:
		print(s * ' ' + i)
		c = c - 1


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // math.gcd(a, b)

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res) % MOD

def comb(n, x):
	(a, b) = (1, 1)
	for i in range(1, x + 1):
		a *= n + 1 - i
		b *= i
	return a // b % MOD

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	if y == 0:
		return 1
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(moves, n):
	val = (moves + 1) // 2
	rem = moves - val
	sol = (val + 1) * (rem + 1)
	return sol < n

def sortSecond(val):
	return val[1]
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
small = 'abcdefghijklmnopqrstuvwxyz'
large = small.upper()
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect
import functools as fnt
from decimal import Decimal

def solve():
	s = string()
	text = []
	a = ''
	for x in s:
		a = a + x
		if x == '>':
			text.append(a)
			a = ''
	i = 0
	s = 0
	while s < len(text):
		if text[s][1] == '/':
			i -= 1
			print(' ' * i * 2 + text[s])
		else:
			print(' ' * i * 2 + text[s])
			i += 1
		s += 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = 1
for i in range(t):
	solve()


s = input()
a = []
b = []
c = 0
for x in range(len(s)):
	if ord(s[x]) >= 97 and ord(s[x]) <= 122:
		if s[x - 1] == '/':
			a.append('/' + s[x])
		else:
			a.append(s[x])
for x in a:
	if len(x) == 1:
		b.append(c)
		c += 1
	else:
		c -= 1
		b.append(c)
for x in range(len(a)):
	print('  ' * b[x] + '<' + a[x] + '>')


(s, k) = (input().split('<')[1:], 0)
for c in s:
	if c[0] == '/':
		print('  ' * (k - 1), '<', c, sep='')
		k -= 1
	else:
		print('  ' * k, '<', c, sep='')
		k += 1


t = input()
(i, n, d) = (0, len(t), -2)
while i < n:
	if t[i + 1] != '/':
		d += 2
		print(' ' * d + t[i:i + 3])
		i += 3
	else:
		print(' ' * d + t[i:i + 4])
		d -= 2
		i += 4


inp_ = input()
tags = inp_.split('<')[1:]
counter = 0
arry = []
for i in tags:
	if i[0] != '/':
		counter += 1
		arry.append(counter)
	else:
		arry.append(counter)
		counter -= 1
for (i, val) in enumerate(tags):
	print(' ' * 2 * (arry[i] - 1) + '<' + val)


x = input()[1:-1].split('><')
n = 0
for i in range(len(x)):
	c = x[i]
	if '/' not in c:
		print('{}<{}>'.format(' ' * 2 * n, c))
		n += 1
	else:
		n -= 1
		print('{}<{}>'.format(' ' * 2 * n, c))


from string import ascii_lowercase

def print_end_tag(level, character):
	print('  ' * level + f'</{character}>' if level else f'</{character}>')

def print_start_tag(level, character):
	print('  ' * level + f'<{character}>' if level else f'<{character}>')

def main():
	xml_line = input()
	counter = 0
	last_character = ''
	for character in xml_line:
		if character == '<' or character == '>':
			continue
		if character in ascii_lowercase:
			end_tag = True if last_character == '/' else False
			if not end_tag:
				print_start_tag(counter, character)
				counter += 1
			else:
				counter -= 1
				print_end_tag(counter, character)
		last_character = character
main()


xml = input()
xml = xml.strip('<')
xml = xml.strip('>')
l = xml.split('><')
level = -1
for current in l:
	if current[0] == '/':
		current = current[1]
		level -= 2
		if level == -1:
			print('</{}>'.format(current))
		else:
			print(' ' * level, '</{}>'.format(current))
	else:
		if level == -1:
			print('<{}>'.format(current))
		else:
			print(' ' * level, '<{}>'.format(current))
		level += 2


s = input()
n = len(s)
a = []
ans = ''
for i in range(n - 1):
	if s[i] == '<' and s[i + 1] != '/':
		a.append(0)
	elif s[i] == '<' and s[i + 1] == '/':
		a.append(1)
k = 2 * n // 7
t = 0
pos = 0
r = ' '
h = 0
for i in range(k):
	if a[i] == 0:
		t = 4
		h += 2
		ans += (h - 2) * r + s[pos:pos + t - 1] + '\n'
	else:
		t = 5
		h -= 2
		ans += h * r + s[pos:pos + t - 1] + '\n'
	pos += t - 1
print(ans)


s = input().split('<')[1:]
level = -1
arr = set()
f = False
for i in s:
	f = False
	if i[0] != '/':
		f = True
	if f:
		level += 1
	print(' ' * (2 * level) + '<' + i)
	if not f:
		level -= 1


a = input()
lst = []
for i in a:
	if i == '<':
		sl = []
		sl.append('<')
	else:
		sl.append(i)
		if i == '>':
			lst.append(sl)
sp = 0
li = 0
for i in lst:
	if li != 0:
		if lst[li][1] != '/' and lst[li - 1][1] != '/':
			sp += 1
	for x in range(2 * sp):
		print(' ', end='')
	for x in i:
		print(x, end='')
	print()
	if li < len(lst) - 1:
		if lst[li][1] == '/' and lst[li + 1][1] == '/':
			sp -= 1
	li += 1


xml = input()
xmlc = list(xml)
xmlw = []
word = ''
total = -1
for i in range(0, len(xmlc)):
	word = word + xmlc[i]
	if xmlc[i] == '>':
		if '/' in word:
			xmlw.append([word, total])
			total = total - 1
		else:
			total = total + 1
			xmlw.append([word, total])
		word = ''
spaces = ''
for i in range(0, len(xmlw)):
	for j in range(0, int(xmlw[i][1]) * 2):
		spaces = spaces + ' '
	print(spaces, end='')
	print(xmlw[i][0])
	spaces = ''


t = input()
u = 0
s = 0
p = ''
while True:
	p += t[s]
	if p.count('<') == 1 and p.count('>') == 1:
		if '/' not in p:
			print(2 * u * ' ' + p)
			u += 1
			p = ''
		else:
			u -= 1
			print(2 * u * ' ' + p)
			p = ''
	if s < len(t) - 1:
		s += 1
	else:
		break


s = input().split('>')
del s[-1]
s = [i + '>' for i in s]
h = 0
for i in s:
	if '/' in i:
		h -= 1
		print(h * 2 * ' ' + i)
	else:
		print(h * 2 * ' ' + i)
		h += 1


l = list(input())
j = 0
c = -1
while j < len(l):
	if l[j] == '<' and l[j + 1] != '/':
		c += 1
		for i in range(2 * c):
			print(' ', end='')
		print(l[j], end='')
		print(l[j + 1], end='')
		print(l[j + 2])
		j += 3
	if l[j] == '<' and l[j + 1] == '/':
		for i in range(2 * c):
			print(' ', end='')
		print(l[j], end='')
		print(l[j + 1], end='')
		print(l[j + 2], end='')
		print(l[j + 3])
		j += 4
		c -= 1


s = input()
s2 = s.split('<')
countPara = 0
table = {}
for i in range(1, len(s2)):
	if len(s2[i]) == 3:
		countPara -= 2
		print(' ' * countPara + '<', sep='', end='')
		print(s2[i])
	elif len(s2[i]) == 2:
		print(' ' * countPara + '<', sep='', end='')
		print(s2[i])
		countPara += 2


class El:

	def __init__(self, w, h, o):
		self.w = w
		self.h = h
		self.o = o

class Els:

	def __init__(self, s):
		self.ws = list()
		self.s = s
		self.ltw = dict()
		self.ss = {'<', '/', '>'}
		self.h = 0
		self.mh = 0
		self.ptc = dict()

	def mba(self, b):
		w = self.ltw[self.s[b:b + 1]]
		for c in w:
			l = len(c)
			if self.s[b:b + l] == c and b > 0:
				if self.s[b - 1:b] == '<':
					return (1, 1, c, l)
				elif self.s[b - 1:b] == '/':
					return (1, 0, c, l)
		return (0, 0, '', 0)

	def hadd(self):
		self.h += 1
		if self.mh < self.h:
			self.mh = self.h

	def add(self, w, o):
		if len(self.ws) > 0:
			l = self.ws[-1]
		else:
			l = None
		if l != None:
			if o and l.o:
				self.hadd()
			if o == 0 and l.o == 0:
				self.h -= 1
		self.ws.append(El(w, self.h, o))

	def gs(self, b):
		c = b
		while c < len(self.s) - 1:
			c += 1
			if self.s[c:c + 1] in self.ss:
				break
		if self.s[b - 1:b] == '<':
			o = 1
		else:
			o = 0
		return (o, self.s[b:c], c - b)

	def al(self, w):
		if w[0:1] in self.ltw:
			self.ltw[w[0:1]].append(w)
		else:
			self.ltw[w[0:1]] = [w]

	def check(self):
		c = 0
		l = 0
		while c < len(self.s):
			if self.s[c:c + 1] not in self.ss:
				if self.s[c:c + 1] in self.ltw:
					(i, o, w, l) = self.mba(c)
				else:
					i = 0
				if i:
					self.add(w, o)
				else:
					(o, w, l) = self.gs(c)
					self.al(w)
					self.add(w, o)
				c += l
			else:
				c += 1
		return self.ws

	def pc(c, o):
		if o:
			print('<{}>'.format(c))
		else:
			print('</{}>'.format(c))

	def pr(self):
		for c in self.ws:
			print(2 * c.h * ' ', end='')
			Els.pc(c.w, c.o)
s = input()
e = Els(s)
els = e.check()
e.pr()


ch = input()
space = ''
result = ''
while len(ch) > 0:
	if ch.find('</') > ch.find('<'):
		result += space + ch[:ch.find('>') + 1] + '\n'
		space += '  '
		if ch.find('>') < len(ch):
			ch = ch[ch.find('>') + 1:]
		else:
			ch = ''
	else:
		space = space[:len(space) - 2]
		result += space + ch[:ch.find('>') + 1] + '\n'
		if ch.find('>') < len(ch):
			ch = ch[ch.find('>') + 1:]
		else:
			ch = ''
print(result)


string = input()
tags = []
tag = ''
for t in string:
	tag += t
	if t == '>':
		tags.append(tag)
		tag = ''
v = 0
for tag in tags:
	if '/' in tag:
		v -= 1
		print('  ' * v, end='')
		print(tag)
	else:
		print('  ' * v, tag, sep='')
		v += 1


x = input()
level = -1
while len(x) > 0:
	if x[1] != '/':
		level += 1
		print(level * '  ' + x[:3])
		x = x[3:]
	else:
		print(level * '  ' + x[:4])
		x = x[4:]
		level -= 1


import re
xml = re.findall('</?\\w>', input())
h = -1
opened = []
for tag in xml:
	tag_name = re.search('\\w', tag).group()
	closing = '/' in tag
	if not closing:
		opened.append(tag_name)
		h += 1
	print('%s%s' % (' ' * 2 * h, tag))
	if closing:
		opened.remove(tag_name)
		h -= 1


st = input()
ls = st.replace('><', ' ')[1:-1].split()
stack = []
tag = 0
for i in ls:
	if i[0] != '/':
		stack.append([i, tag])
		ans = '  ' * tag + '<' + i + '>'
		print(ans)
		tag += 1
	else:
		(char, tage_value) = stack.pop()
		ans = '  ' * tage_value + '</' + i[1] + '>'
		print(ans)
		tag -= 1