import strutils, sequtils var n = stdin.readLine.parseInt m = stdin.readLine.parseInt a = newSeqWith(3, 0) a[n-1] = 1 for i in 0..