#!/usr/bin/python
# -*- coding: utf-8 -*-
import q20
import re

equal = '='
target = re.compile(equal)
for t in q20.british_find().split('\n'):
    if target.match(t):
        level = t.count(equal) / 2 - 1
        section_name = target.sub('', t).replace(' ', '')
        print section_name, level
