import java.util.*;
import java.io.*;

//import java.math.*;

public class cipher_sp implements Runnable {
	public static void main(String[] args) {
		new Thread(new cipher_sp()).start();
	}

	@Override
	public void run() {
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	private final String FNAME = "cipher";
	
	int MAX = 1000;

	void solve() {
		String s = nextToken();
		assert s.length() > 0 && s.length() <= MAX;
		String max = s;
		for (int i = 1; i < s.length(); i++) {
			if (max.compareTo(s.substring(i)) < 0) {
				max = s.substring(i);
			}
		}
		out.println(max);
	}
}