def solve(line): x, y, z = line.strip().split() if x == "0" and y == "0" and z == "0": return x = x.replace(y, z) x = list(x) while x[0] == "0": x.pop(0) print "".join(x) while True: try: value = raw_input() solve(value) # next line was found except (EOFError): break #end of file reached