import re import sys pattern = re.compile(r"(#{1}(?![0-9])([A-Z]|[a-z]|\d)+)") for line in sys.stdin: x = re.findall(pattern, line) output = [] for g in x: output.append(g[0]) output_str = ";".join(output) if not output_str: print("") else: print(output_str)