import sequtils, strutils let n, m = parseInt readLine stdin var o = false.repeat 4 o[n] = true for _ in 0..