N = int(input()) sList = list(map(str, input().split())) tList = list(map(str, input().split())) for i in range(N): if sList[i] != tList[i]: print(i+1) print(sList[i]) print(tList[i])