import sys

def main(lines):

    #len_lines = len(lines)
    n = int(lines.pop(0))
    products = []
    #m = []
    products_code = []
    c_products = [[] for i in range(10000)]
    #print(c_products)
    c = 1

    for k in range(n):
        products.append(lines.pop(0))
    for k in range(n):
        products_code.append(products[k].split())
    
    #print(lines)
    for line in lines:
        print(line)
        if line == "start":
            c += c+1
            lines.pop(0)
            print(lines)

            while line.split()[0] != "start":
                c_products[c]=lines.pop(0)
                print(lines)
            #print(line.split()[0])
            #print(c_products)
        print("--------")
        
    for i in range(c):
        print(c_products[i])
        
'''
            line += line + 1
            for line in lines:
                c_products = line.split()
                print(c_products)
                if "end" in line:
                    break
            if "end" in line:
                break
'''
                
'''
for j in range(len_lines - n - 2):
        if lines[j] == "start":
            c += 1
            j += j+1
            while "end" not in lines[j]:
                c_products = lines[j].split()
                print(c_products)
                j += j+1

'''

    #print(c_products)
    
    #print(products_code)
    #print(products_code[1][1])

    #これでlinesには会計情報しか入ってない

    #1～1+n行目まではお店が元々設定してる商品の情報。
    #それ以降はお客様の会計情報

if __name__ == '__main__':
    lines = []
    for l in sys.stdin:
        lines.append(l.rstrip('\r\n'))
        if l=="\n":
            break
    main(lines)
