import sys
import re

data = int(sys.argv[1])*2
y = {}

with open(sys.argv[2],'r')as f:
	for line in f:
		if not "?" in line:
			line = line[8:].replace("\n","").replace(" ","").strip() 
			parts = [line[i:i+data] for i in range(0, len(line), data)]
			for i in parts:
				if i in y.keys():
					y[i] = y[i]+1
				else:
					y[i] = 1



for i in y.keys():
	if y[i] != 0:
		print("{} ---> {}".format(' '.join(re.findall(r'.{1,2}',i) ),y[i]))     
