input = """miasmax,2,34
airmure,58,146
otaria,-5,-111
papilord,-28,144
viskuse,27,140
hypotrempe,38,-62
polichombr,33,72
suicune,5,22
celebi,65,121
otaria,-7,-114
parecool,77,-138
gamblast,74,-23
rexillius,13,150
gamblast,-22,107
feunnec,77,174
airmure,-71,113
statitik,-80,-102
krabboss,-41,73
celebi,-79,83
givrali,-64,-153
poichigeon,76,29
insolourdo,51,12
phogleur,-61,-21
papilord,33,-70
tutankafer,56,152
insolourdo,-45,163
polichombr,7,23
papilord,-71,77
ymphect,2,-142
blizzaroi,-23,-63
farfuret,-12,153
feunard,76,-84
suicune,-74,-41
poichigeon,34,-126
korillon,-66,-142
rexillius,-29,126
poichigeon,-68,-99
zigzaton,68,-29
feunnec,37,72
excelangue,82,-58
capumain,89,-97
colimucus,63,-134
ymphect,-47,82
golemastoc,-62,-176
otaria,23,64
feunnec,40,158
embrylex,-45,-48
gamblast,6,-44
marisson,-82,78
celebi,29,-15
sablaireau,58,-98
krabboss,43,113
golemastoc,-72,61
excelangue,30,74
tutankafer,57,4
couafarel,-76,98
hypotrempe,-69,52
korillon,-67,128
maganon,-52,-30
roitiflam,22,51
korillon,55,-138
artikodin,-55,6
roitiflam,-31,68
airmure,-76,38
barpau,47,-17
noacier,-54,107
statitik,25,-92
capumain,61,130
barpau,45,19
feunnec,13,-140
feunard,-54,104
scorvol,-32,-33
zigzaton,31,-80
artikodin,-31,-166
regigigas,11,172
aflamanoir,47,-115
krabboss,-84,-148
galvaran,8,-95
couafarel,12,52
airmure,55,146
polichombr,-47,16
airmure,8,-155
magby,-21,-65
boustiflor,25,76
scorvol,8,-92
poichigeon,19,88
parecool,55,-11
boustiflor,-90,103
golemastoc,-78,170
poichigeon,-46,104
couafarel,-83,-28
regigigas,40,113
galvaran,85,-67
excelangue,49,-47
reshiram,13,134
colimucus,54,-138
regigigas,-40,4
gamblast,49,157
galvaran,82,-130
ohmassacre,-23,28
blizzaroi,-23,-118
miasmax,-16,-133
golemastoc,76,-43
roitiflam,58,-115
golemastoc,-88,-3
gamblast,-43,-81
tutankafer,63,54
feunard,-11,-9
insolourdo,65,-75
coxy,68,-180
artikodin,-66,-31
farfuret,-25,114
tutankafer,15,-143
pikachu,-60,119
magby,-90,-93
lianaja,-58,71
parecool,65,-139
givrali,-73,169
blindalys,74,-111
farfuret,88,-84
porygon,-54,-106
pikachu,22,-1
embrylex,15,-177
phogleur,-22,40
zigzaton,73,-60
gamblast,19,62
suicune,35,149
gamblast,-44,162
pifeuil,-80,-61
otaria,-86,74
excelangue,40,-3
galvaran,-45,-108
krabboss,74,-110
lianaja,-15,125
barpau,-73,-6
blizzaroi,-11,107
magby,39,-114
tutankafer,88,63
rexillius,83,29
poichigeon,10,160
statitik,7,-180
roitiflam,-82,-22
artikodin,71,-91
coxy,-50,-111
roitiflam,-10,-95
artikodin,49,-121
scorvol,6,-82
korillon,42,3
magby,53,-165
roitiflam,37,-50
kirlia,48,-78
miasmax,-19,151
givrali,88,-61
ohmassacre,62,30
barpau,63,153
zigzaton,-8,54
scorvol,-2,-84
insolourdo,-19,146
otaria,-21,-102
regigigas,30,126
lianaja,79,-148
tutankafer,-81,-38
insolourdo,-76,147
galvaran,88,123
airmure,4,-106
feunard,60,152
suicune,-41,158
rexillius,-55,-59
korillon,-55,12
krabboss,-69,45
pikachu,16,-141
coxy,58,-7
coxy,-45,49
viridium,-59,-115
hypotrempe,68,-40
feunnec,-83,-145
reshiram,-38,93
capumain,-29,125
feunard,-36,3
regigigas,67,2
insolourdo,-23,-177
farfuret,-77,-77
lippouti,60,-145
roitiflam,16,101
escroco,1,-80
viridium,27,49
golemastoc,21,36
noacier,47,-41
capumain,55,-84
scorvol,34,-87
parecool,-57,-87
ymphect,74,88
scorvol,-77,23
sablaireau,25,-10
escroco,-78,14
galvaran,21,-148
noacier,39,-129
rexillius,25,-128
zigzaton,-58,74
drakkarmin,-68,125
kirlia,-68,139
suicune,-90,-102
galvaran,87,-56
miasmax,-18,-50
tutankafer,4,-77
xatu,32,158
viridium,-61,49
miasmax,51,-130
viridium,8,-54
golemastoc,-26,102
gamblast,78,5
viridium,-35,11
magby,-27,-93
tutankafer,78,-24
papilord,22,-16
capumain,58,-78
capumain,-9,-156
krabboss,-29,-40
colimucus,69,-89
marisson,59,-165
feunard,-75,-98
kirlia,-6,-128
lippouti,10,132
viridium,33,-124
blizzaroi,-6,159
sablaireau,-52,10
hypotrempe,68,47
capumain,39,15
blizzaroi,-44,7
galvaran,-7,-41
krabboss,1,80
coxy,-32,-163
viskuse,23,168
excelangue,-81,150
maganon,-57,98
statitik,-82,-30
pifeuil,-52,103
artikodin,-52,17
artikodin,-68,160
phogleur,-85,137
xatu,-75,-84
insolourdo,51,-20
artikodin,44,167
mackogneur,8,106
rexillius,28,98
airmure,24,-21
suicune,-20,75
coxy,21,-80
reshiram,-44,139
tutankafer,39,-111
givrali,-30,-174
marisson,-26,175
ymphect,-13,-93
regigigas,78,166
farfuret,7,-24
regigigas,85,-61
polichombr,-23,30
coxy,-81,64
capumain,-23,17
golemastoc,53,117
farfuret,90,-88
korillon,-38,178
galvaran,65,-36
gamblast,73,149
givrali,-45,-98
feunnec,-8,-6
zigzaton,90,172
sablaireau,-4,118
farfuret,30,173
parecool,29,42
hypotrempe,-34,174
barpau,-2,88
pikachu,27,100
coxy,34,66
rexillius,34,164
krabboss,25,-125
pikachu,48,23
celebi,11,-101
rexillius,-20,-121
magby,20,-46
embrylex,-28,-96
pikachu,72,-135
farfuret,80,23
feunard,86,123
farfuret,-61,61
lianaja,77,-179
feunard,-31,-124
zigzaton,88,-80
reshiram,46,179
noacier,0,-64
escroco,-63,165
miasmax,-79,119
parecool,-18,144
blindalys,-57,21
otaria,-28,-28
ymphect,-27,131
noacier,-52,19
feunnec,-44,172
lianaja,45,-29
viridium,67,-61
sablaireau,26,-124
reshiram,55,31
rexillius,-89,58
blizzaroi,59,-46
excelangue,-79,98
regigigas,64,68
lippouti,74,14
insolourdo,59,163
couafarel,13,113
korillon,-44,83
excelangue,-85,81
capumain,-40,-109
maganon,-42,6
lianaja,-38,-3
statitik,-50,-37
drakkarmin,43,-178
porygon,-24,-141
polichombr,14,-36
celebi,-59,137
magby,51,59
escroco,-87,29
escroco,75,-108
statitik,-65,-11
xatu,-62,61
marisson,52,30
pikachu,-72,-109
krabboss,-34,-75
suicune,13,-58
regigigas,86,-133
coxy,-76,57
mackogneur,11,-163
polichombr,-70,-165
ohmassacre,15,129
embrylex,36,-174
kirlia,63,-143
viridium,51,-93
sablaireau,-19,54
phogleur,54,-159
krabboss,39,-150
barpau,90,-27
celebi,-41,41
feunnec,-56,171
korillon,3,-163"""

pokemons = input.splitlines()

res = dict()
for pokemon in pokemons:
    pokemon = pokemon.split(",")[0]
    if pokemon in res:
        res[pokemon] += 1
    else:
        res[pokemon] = 1

min = 100
for pokemon in res:
    if res[pokemon] < min:
        solution = pokemon
        min = res[pokemon]
print(solution)
for pokemon in pokemons:
    if pokemon.split(",")[0] == solution:
        print(pokemon)

