When little Petya grew up and entered the university, he started to take part in АСМ contests. Later he realized that he doesn't like how the АСМ contests are organised: the team could only have three members (and he couldn't take all his friends to the competitions and distribute the tasks between the team members efficiently), so he decided to organize his own contests PFAST Inc. — Petr and Friends Are Solving Tasks Corporation. PFAST Inc. rules allow a team to have unlimited number of members.

To make this format of contests popular he organised his own tournament. To create the team he will prepare for the contest organised by the PFAST Inc. rules, he chose several volunteers (up to 16 people) and decided to compile a team from them. Petya understands perfectly that if a team has two people that don't get on well, then the team will perform poorly. Put together a team with as many players as possible given that all players should get on well with each other.
The first line contains two integer numbers *n* (1 ≤ *n* ≤ 16) — the number of volunteers, and *m* (<img align="middle" class="tex-formula" src="https://espresso.codeforces.com/35327467f2c3b20f43402683e6545bccfc361a3b.png" style="max-width: 100.0%;max-height: 100.0%;"/>) — the number of pairs that do not get on. Next *n* lines contain the volunteers' names (each name is a non-empty string consisting of no more than 10 uppercase and/or lowercase Latin letters). Next *m* lines contain two names — the names of the volunteers who do not get on. The names in pair are separated with a single space. Each pair of volunteers who do not get on occurs exactly once. The strings are case-sensitive. All *n* names are distinct.
3 1
Petya
Vasya
Masha
Petya Vasya
2
Masha
Petya
3 0
Pasha
Lesha
Vanya
3
Lesha
Pasha
Vanya
7 12
Pasha
Lesha
Vanya
Taras
Nikita
Sergey
Andrey
Pasha Taras
Pasha Nikita
Pasha Andrey
Pasha Sergey
Lesha Taras
Lesha Nikita
Lesha Andrey
Lesha Sergey
Vanya Taras
Vanya Nikita
Vanya Andrey
Vanya Sergey
4
Andrey
Nikita
Sergey
Taras
2 0
Andrey
Taras
2
Andrey
Taras
16 0
Taras
Nikita
Sergey
Andrey
Romka
Alexey
Ura
Denis
Egor
Vadim
Alena
Olya
Vanya
Brus
John
Alice
16
Alena
Alexey
Alice
Andrey
Brus
Denis
Egor
John
Nikita
Olya
Romka
Sergey
Taras
Ura
Vadim
Vanya
6 6
Alena
Olya
Vanya
Brus
John
Alice
Alena John
Alena Alice
Olya John
Olya Alice
Vanya John
Vanya Alice
4
Alena
Brus
Olya
Vanya
7 6
Alena
Olya
Vanya
Brus
John
Alice
Mariana
Alena John
Alena Alice
Olya John
Olya Alice
Vanya John
Vanya Alice
5
Alena
Brus
Mariana
Olya
Vanya
1 0
Petr
1
Petr
2 0
NgzlPJgFgz
QfpagVpWz
2
NgzlPJgFgz
QfpagVpWz
2 1
cLWdg
GoWegdDRp
GoWegdDRp cLWdg
1
GoWegdDRp
3 0
r
yVwqs
sdTDerOyhp
3
r
sdTDerOyhp
yVwqs
3 3
vRVatwL
WmkUGiYEn
uvvsXKXcJ
WmkUGiYEn vRVatwL
uvvsXKXcJ vRVatwL
uvvsXKXcJ WmkUGiYEn
1
WmkUGiYEn
16 11
jA
kyRNTE
eY
ToLcqN
bnenhMxiK
zlkOe
XCKZ
eaQrds
qUdInpi
KgPQA
mQIl
inOCWEZHxy
yA
PIZRMOu
XtueKFM
fRNwNn
inOCWEZHxy qUdInpi
KgPQA zlkOe
inOCWEZHxy KgPQA
fRNwNn XCKZ
inOCWEZHxy eY
yA mQIl
inOCWEZHxy ToLcqN
yA KgPQA
qUdInpi ToLcqN
qUdInpi eaQrds
PIZRMOu eY
10
KgPQA
PIZRMOu
ToLcqN
XCKZ
XtueKFM
bnenhMxiK
eaQrds
jA
kyRNTE
mQIl
12 12
jWuGgOjV
Ws
jTZQMyH
ULp
UfsnPRt
k
bPKrnP
W
JOaQdgglDG
Aodc
cpRjAUyYIW
MrjB
bPKrnP ULp
k Ws
cpRjAUyYIW k
ULp jTZQMyH
bPKrnP jWuGgOjV
cpRjAUyYIW jTZQMyH
W ULp
k jTZQMyH
k ULp
MrjB ULp
cpRjAUyYIW Aodc
W k
8
Aodc
JOaQdgglDG
MrjB
UfsnPRt
W
Ws
bPKrnP
jTZQMyH
11 17
jFTNgFBO
tZDgmdF
IjeDjoj
BEMAaYkNb
RZRQl
tK
lNHWt
IdG
LAbVLYiY
otOBsWqJuo
UoTy
tK BEMAaYkNb
BEMAaYkNb jFTNgFBO
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RJCv
sitechE LJ
rAG YiUXqlBUx
sitechE QNgYuX
4
ITtwRJCv
LJ
YiUXqlBUx
dPtyZ
9 6
fLfek
EQPcotnrp
CaAlbwoIL
VG
NAZKIBiKT
oFy
jFluh
KqHXRNya
QSwgobA
oFy EQPcotnrp
KqHXRNya jFluh
oFy NAZKIBiKT
jFluh oFy
jFluh fLfek
oFy fLfek
7
CaAlbwoIL
EQPcotnrp
KqHXRNya
NAZKIBiKT
QSwgobA
VG
fLfek
9 14
moRNeufngu
BSKI
zXl
gwmIDluW
YFn
HvasEgl
XcAC
eVP
AiOm
eVP BSKI
eVP YFn
HvasEgl YFn
eVP XcAC
AiOm HvasEgl
XcAC YFn
zXl moRNeufngu
eVP zXl
HvasEgl BSKI
XcAC gwmIDluW
XcAC HvasEgl
YFn moRNeufngu
zXl BSKI
HvasEgl gwmIDluW
4
AiOm
BSKI
YFn
gwmIDluW
15 8
cXeOANpvBF
bkeDfi
nsEUAKNxQI
oSIb
aU
XYXYVo
duZQ
aPkr
PVrHpL
mVgmv
hHhukllwbf
GkNPGYVxjY
bgBjA
slNKCLIlOv
mPILXy
bgBjA cXeOANpvBF
GkNPGYVxjY cXeOANpvBF
slNKCLIlOv GkNPGYVxjY
GkNPGYVxjY mVgmv
XYXYVo cXeOANpvBF
slNKCLIlOv bkeDfi
mVgmv aPkr
slNKCLIlOv nsEUAKNxQI
12
GkNPGYVxjY
PVrHpL
XYXYVo
aPkr
aU
bgBjA
bkeDfi
duZQ
hHhukllwbf
mPILXy
nsEUAKNxQI
oSIb
15 3
a
YclKFJoaIA
halYcB
bLOlPzAeQ
tckjt
oDFijpx
b
pz
VDLb
lCEHPibt
oF
pzJD
MC
qklsX
TAU
pzJD tckjt
qklsX oF
MC pzJD
13
MC
TAU
VDLb
YclKFJoaIA
a
b
bLOlPzAeQ
halYcB
lCEHPibt
oDFijpx
oF
pz
tckjt
16 8
JIo
INanHVnP
KaxyCBWt
kVfnsz
RAwFYCrSvI
F
vIEWWIvh
TG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
8
IEAYCq
WX
Xozwkum
e
iPwfd
ltmruh
meJa
tIWi
16 11
tulhZxeKgo
brAXY
yQUkaihDAg
mwjlDVaktK
weVtBIP
zRwb
ds
hXPfJrL
AdIfP
azQeXn
B
JlmscIUOxO
Zuxr
V
OfyLIUO
uaMl
hXPfJrL yQUkaihDAg
weVtBIP yQUkaihDAg
azQeXn hXPfJrL
V tulhZxeKgo
zRwb yQUkaihDAg
ds mwjlDVaktK
zRwb brAXY
yQUkaihDAg brAXY
B yQUkaihDAg
AdIfP mwjlDVaktK
brAXY tulhZxeKgo
11
AdIfP
B
JlmscIUOxO
OfyLIUO
V
Zuxr
azQeXn
brAXY
ds
uaMl
weVtBIP
5 10
Taras
Nikita
Sergey
Andrey
Romka
Taras Romka
Taras Nikita
Taras Sergey
Taras Andrey
Romka Nikita
Romka Sergey
Romka Andrey
Nikita Sergey
Nikita Andrey
Sergey Andrey
1
Andrey

def main():
    n, m = map(int,input().split(" "))
    volunteers = []
    for i in range(n):
        x = input()
        volunteers.append(x)
    pairs = dict()
    for i in range(m):
        x, y = input().split(" ")
        if x in pairs:
            pairs[x].append(y)
        else:
            pairs[x] = [y]
        if y in pairs:
            pairs[y].append(x)
        else:
            pairs[y] = [x]
    result = []
    for x in volunteers:
        if x not in pairs:
            result.append(x)
            volunteers.remove(x)
    while len(pairs.keys())!= 0:
        c = 0
        delete = 0
        for x in volunteers:
            if len(pairs[x]) > c:
                delete = x
        volunteers.remove(delete)
        for x in pairs[delete]:
            pairs[x].remove(delete)
        del pairs[delete]
        for x in volunteers:
            if len(pairs[x]) == 0:
                result.append(x)
                volunteers.remove(x)
                del pairs[x]
    result.sort()
    print(len(result))
    for i in result:
        print(i)
 
if __name__ == "__main__":
    main()