program pil_8_59(input,output);
var
  mas : array ['a'..'z'] of 0..maxint;
  b : array ['a'..'z'] of boolean;
  max : 0..maxint;
  c, t : char;
begin
  for c:='a' to 'z' do mas[c] := 0;
  repeat
  	read(c);
		for t:='a' to 'z' do b[t] := false;
    while (c<>',')and(c<>'.') do begin
      if not(b[c]) then begin
        b[c] := true;
        mas[c] := mas[c] + 1;
        read(c);
      end;
    end;
  until c='.';
  max := mas['a'];
  for c:='b' to 'z' do
    if max<mas[c] then
      max := mas[c];

  for c:='a' to 'z' do
    if mas[c]=max then Write(c, ' ');

end.
