summaryrefslogtreecommitdiff
blob: 15f000b67e727d7c6fbdc224d51f3d8146a65f50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
import sys

solutions = list()

for line in sys.stdin.readlines():
    line_data = line.split(":")
    line_number = line_data[0]
    solution_number = int(line_data[2])
    solution_item_number = line_data[3].replace("$",'')

    if (len(solutions) <= solution_number):
        solutions.insert(solution_number, list())

    solutions[solution_number].insert(
        int(solution_item_number),
        ("\"" + line_number + "\"")
    )

for sol in solutions:
    print("(" + (' '.join(sol)) + ")")