---
# System prepended metadata

title: f442. 老鷹抓小雞 Eagle

---

# f442. 老鷹抓小雞 Eagle
## 題目連結: [f442](https://zerojudge.tw/ShowProblem?problemid=f442)

## 解題想法
* 照題目的要求把每項輸入存進變數裡
* 重複`num`次，把老鷹(ghost)跟被抓到的小雞做交換

## 程式碼
```python=
#input
num = int(input())
data = [int(i) for i in input().split()]
ghost = int(input())
rounds = int(input())
catched = [int(i) for i in input().split()]

#start
for i in range(rounds):
    place = data.index(catched[i])
    ghost,data[place] = data[place],ghost

print(*data)
