Var
a : array['a'..'z'] of integer;
t : array['a'..'z'] of boolean;
m : integer;
c : char;
begin
m := 0;
for c := 'a' to 'z' do
a[c] := 0;
repeat
for c := 'a' to 'z' do
t[c] := false;
read(c);
while (c <> ',') and (c <> '.') do
begin
if not t[c] then
begin
a[c] := a[c] + 1;
if a[c] > m then
m := a[c];
t[c] := true
end;
read(c)
end
until c = '.';
for c := 'a' to 'z' do
if a[c] = m then
write(c,' ')
end.