func main() var ss: [][]char :: cui@input().split(" ") var n: int :: ss[0].toInt(&) var m: int :: ss[1].toInt(&) var mp: dict :: #dict var s: []char var j: int do s :: cui@input() ~ " " ~ cui@input() ~ " " do j :: 0 for i(0, n - 1) var val: int :: 0 while(s[j] <> ' ') do val :: val * 10 + s[j] $ int - 48 do j :+ 1 end while do j :+ 1 do mp.add(val, mp.get(val, &) + 1) end for for i(0, m - 1) var val: int :: 0 while(s[j] <> ' ') do val :: val * 10 + s[j] $ int - 48 do j :+ 1 end while do j :+ 1 do cui@print("\{mp.get(val, &)} ") end for end func