S = input() s1 = "" s2 = "" s3 = "" for i in S: if "0" <= i <= "9": s2 += i elif "A" <= i <= "Z" or "a" <= i <= "z": s1 += i else: s3 += i print(s1, s2, s3, sep="\n")