Python 3,感觉好像没什么问题啊QAQ
s=input().split() a=input() b=input() for i in s: if i==a: print(b,end=' ') else: print(i,end=' ')