var
  i, j, max : longint;
  s : string;
begin
  assign(input, 'cipher.in');
  assign(output, 'cipher.out');
  reset(input);
  rewrite(output);
  readln(s);
  max := 1;
  for i := 2 to length(s) do begin
    j := 0;
    while (i + j <= length(s)) and (s[max + j] = s[i + j]) do begin
      j := j + 1;
    end;
    if (i + j <= length(s)) and (s[i + j] > s[max + j]) then begin
      max := i;
    end;
  end;
  for i := max to length(s) do begin
    write(s[i]);
  end;
end.
