2023-10-30 09:09:03 +00:00
|
|
|
import sys
|
|
|
|
import re
|
|
|
|
|
|
|
|
pat = re.compile(r"\[(\d+)\] (.*)")
|
|
|
|
|
|
|
|
outputs = {}
|
|
|
|
|
|
|
|
for line in sys.stdin.readlines():
|
|
|
|
m = pat.match(line)
|
|
|
|
if not m:
|
|
|
|
# print(line)
|
|
|
|
continue
|
|
|
|
p = int(m.group(1))
|
|
|
|
rest = m.group(2)
|
|
|
|
|
|
|
|
if p not in outputs: outputs[p] = []
|
|
|
|
outputs[p].append(rest)
|
|
|
|
|
|
|
|
for p in sorted(outputs.keys()):
|
|
|
|
lines = outputs[p]
|
|
|
|
print(f"---- {p} ----")
|
|
|
|
for line in lines:
|
|
|
|
print(line)
|
2023-10-30 09:35:04 +00:00
|
|
|
print()
|
|
|
|
|
|
|
|
print("Done.")
|