djfz-2020-s444507/TaskB04/run.py

12 lines
216 B
Python

import re
import sys
pattern = re.compile(r"\d+")
# pattern = re.compile(r"(?<= )\d+(?= )|\d+(?= )|(^\d+$)|(?<= )\d+")
for line in sys.stdin:
x = re.findall(pattern, line)
if x:
print(" ".join(x))