I have two files: file1.txt and file2.txt

```
#file1.txt
xap1
NM_121
abc4
xxx0
uvw

#file2.txt
A123  001  xap1    mmmmm
B123       xxx0    nnnnn
C123  003  yyy1    ppppp
D123  004  zzz1    NM_121
E123  005  abc4    llllll
F123       jjjj    www

```

I want following output based on matching of column 1 of file1 with column 3 and column 4 of file2, get column 2 from file2 and print both:

```
#file3.txt
xap1    001
NM_121  004
abc4    005
xxx0    NA
uvw     NA

```

I used the following command, but don't know how to print column 1 from file1:

```
grep -w -F -f file1.txt file2.txt | awk '{print $2) > file3.txt

```

Thanks.