Files common in two sets ??? How to find ??

Suppose we have 2 set of files

set 1 set 2
------ ------
abc hgb
def ppp
mgh vvv
nmk sdf
hgb xxx
sdf mmm

The two sets can have common files (like sdf and hgb above ).
i am developing a script which checks files that are common in both sets and print those.

Can anyone help in this?

grep -f set1 set2