#!/usr/bin/env python3

import sys
import fileinput

nummer = 0
strophe = []

def print_strophe():
    global strophe, nummer
    if not strophe:
        return

    nummer += 1
    print(nummer)
    for i in range(0, len(strophe), 2):
        zeile1, annot1, pattern1, code1 = strophe[i].strip().split("\t")
        zeile2, annot2, pattern2, code2 = strophe[i+1].strip().split("\t")
        print(zeile1+'  '+zeile2, annot1+'  '+annot2,
              pattern1+'  '+pattern2, code1+'+'+code2, sep="\t")
    strophe = []
    

for line in fileinput.input():
    line = line.strip()
    if not line:
        print_strophe()
    else:
        strophe.append(line)
print_strophe()
