func main() var n: int :: cui@inputInt() var m: int :: cui@inputInt() var map: dict :: #dict for(1, n) var val: int :: cui@inputInt() do map.add(val, map.get(val, &) + 1) end for for i(1, m) var val: int :: cui@inputInt() do cui@print("\{map.get(val, &)}" ~ (i = m ?("\n", " "))) end for end func