import sys import re s = input() a = re.match(r'\d+([-(\d+)])+', s) print(s[a.span()[0]: a.span()[1]])