n | s = input() | n | a = input() |
| l = [] | | l = [] |
n | while s: | n | while a: |
| s = s.split() | | a = a.split() |
| i, f, *k, v = s | | i, f, *k, v = a |
| l += [[[int(t) for t in v.split(':')], f, i, ' '.join(k)]] | | l += [[[int(t) for t in v.split(':')], f, i, ' '.join(k)]] |
n | s = input() | n | a = input() |
| l.sort() | | l.sort() |
| l1 = sorted({tuple(i[0]) for i in l}) | | l1 = sorted({tuple(i[0]) for i in l}) |
| l1 = l1[0:3] | | l1 = l1[0:3] |
| l2 = [x for x in l if tuple(x[0]) in l1] | | l2 = [x for x in l if tuple(x[0]) in l1] |
| max_n = 0 | | max_n = 0 |
n | max_s = 0 | n | max_a = 0 |
| max_k = 0 | | max_k = 0 |
| for i in l2: | | for i in l2: |
| if len(i[2]) > max_n: | | if len(i[2]) > max_n: |
| max_n = len(i[2]) | | max_n = len(i[2]) |
n | if len(i[1]) > max_s: | n | if len(i[1]) > max_a: |
| max_s = len(i[1]) | | max_a = len(i[1]) |
| if len(i[3]) > max_k: | | if len(i[3]) > max_k: |
| max_k = len(i[3]) | | max_k = len(i[3]) |
| for i in l2: | | for i in l2: |
| print(i[2] + (max_n - len(i[2]))*' ', | | print(i[2] + (max_n - len(i[2]))*' ', |
t | i[1] + (max_s - len(i[1]))*' ', | t | i[1] + (max_a - len(i[1]))*' ', |
| i[3] + (max_k - len(i[3]))*' ', | | i[3] + (max_k - len(i[3]))*' ', |
| str(i[0][0])+":"+str(i[0][1])+":" + str(i[0][2])) | | str(i[0][0])+":"+str(i[0][1])+":" + str(i[0][2])) |
| | | |