import sys

branches_pcfr = {}
branches_scfr = {}

for line in sys.stdin.readlines():
	cols = line.split()
	bm = cols[0]
	b_pcfr = int(cols[3])
	b_scfr = int(cols[18])
	branches_pcfr[bm] = branches_pcfr.get(bm, 0) + b_pcfr
	branches_scfr[bm] = branches_scfr.get(bm, 0) + b_scfr

keys = sorted(branches_pcfr.keys())

sys.stdout.write('\\bgroup\\def\\arraystretch{1.5}')
sys.stdout.write('\\setlength{\\tabcolsep}{1.8pt}')
sys.stdout.write('''\\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
''')
sys.stdout.write('& ' + ' & '.join('\\rotatebox{90}{\\small %s\\,}' % key for key in keys) + '\\\\\n')
sys.stdout.write('\\hline\n')
sys.stdout.write('{\\small \\rule{0pt}{1.1em}SCFR}& ' + ' & '.join('%d' % branches_scfr[key] for key in keys) + '\\\\\n')
#sys.stdout.write('\\hline\n')
sys.stdout.write('{\\small \\rule{0pt}{1.1em}PCFR}& ' + ' & '.join('%d' % branches_pcfr[key] for key in keys) + '\\\\\n')
sys.stdout.write('\\hline\n')
sys.stdout.write('{\\small \\rule{0pt}{1.1em}Savings \\%}& ' + ' & '.join('\\textbf{%3.1f}' % (branches_scfr[key]*100.0/branches_pcfr[key] - 100.0) for key in keys) + '\\\\\n')
sys.stdout.write('\\hline\n')
sys.stdout.write('\\end{tabular}\n')
sys.stdout.write('\\egroup')
#print '
#print branches_pcfr
#print branches_scfr
