import strutils, sequtils let N, A = stdin.readLine.split.map parseInt var arr = newSeqWith(0, 0) for i in 0 ..< N[0]: arr.add i + 1 for i in 0 ..< A.len: let idx = A[i] - 1 swap(arr[0], arr[idx]) echo arr[0]