n = io.read("*n", "*l") as = io.read() bs = io.read() a = {} b = {} for w in as:gmatch("%w+") do if not a[w] then a[w] = 1 else a[w] = a[w] + 1 end end for w in bs:gmatch("%w+") do if not b[w] then b[w] = 1 else b[w] = b[w] + 1 end end for k, v in pairs(a) do if not b[k] or b[k] < v then print(k) end end