import re import sys for line in sys.stdin: stripped_line = line.strip() if re.search("\d+", stripped_line): sub = re.findall("\d+", stripped_line) print(' '.join(sub))