"""a,b=map(int,input().split()) c=list(map(int,input().split())) ttm=0 sk=0 cm=0
for i in c: ttm+=i if(sum(c)-ttm>=b): sk+=1 if(sum(c)<b): print(-1) else: print(sk)""" """a,b=map(int,input().split()) c=list(map(int,input().split())) d=list(map(int,input().split())) ttm=0 sk=[] e=set(c) f=set(d) for i in e: if i in f: ttm+=1 sk.append(i) ss=sk.sort() print(ttm) print(*sk)"""