#!/usr/bin/python

import sys
import re

size = 0
g1 = []
g2 = []
g3 = []
g4 = []
g5 = []

for line in sys.stdin:

    if re.match(' *\d', line):

        [s, x1, x2, x3, x4, x5, term] = line.split(None, 6)

        if size != 0 and s != size:
            print '----------------------------'
            print '     %2d     %2d     %2d     %2d     %2d' % (len(g1),len(g2),len(g3),len(g4),len(g5)) 
            print '============================'
            g1 = []
            g2 = []
            g3 = []
            g4 = []
            g5 = []
 
        sys.stdout.write(line)
        if x1 not in g1:
            g1.append(x1)
        if x2 not in g2:
            g2.append(x2)
        if x3 not in g3:
            g3.append(x3)
        if x4 not in g4:
            g4.append(x4)
        if x5 not in g5:
            g5.append(x5)
    
        size = s


        
        
