私が書いたのはこれ
A,B,N = map(int,input().split())
S = list(map(int,input().split()))
for i in range(len(S)):
if i + 1== A:
tmp = S[B-1]
S[B-1] = S[A-1]
S[A-1] = tmp
break
for i in S:
print(i)
でもよく考えたら、
べつにif文なくてもそのまま変えたらいいだけだった。。。
答え見てわかってしまったorz