import sys import re regex = re.compile('^((\+|0)([0-9]{2})) ([0-9]-[0-9]{3}-[0-9]{3}|[0-9]{3}-[0-9]{2}-[0-9]{2})$') for line in sys.stdin: if regex.match(line.replace('\n', '')): print(regex.match(line.replace('\n', '')).group(3)) else: print('')