for w in raw_input().split(';'):print''.join(w[int(d)]for d in w if':'>d)