#!/usr/bin/env python3 n=int(input()) s=input().split() t=input().split() for i in range(n): if s[i] != t[i]: print("{}\n{}\n{}\n".format(i+1,s[i],t[i]))