import java.io.IOException;
import java.util.StringTokenizer;
import java.io.InputStreamReader;
import java.io.BufferedReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int N = Integer.parseInt(st.nextToken());
int M = Integer.parseInt(st.nextToken());
N = (N % 10) * 100 + (N / 10 % 10) * 10 + N / 100;
M = (M % 10) * 100 + (M / 10 % 10) * 10 + M / 100;
if(N > M)
System.out.print(N);
else
System.out.print(M);
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine()," ");
int A = Integer.parseInt(new StringBuilder(st.nextToken()).reverse().toString());
int B = Integer.parseInt(new StringBuilder(st.nextToken()).reverse().toString());
System.out.print(A > B ? A:B);
}
}
StringBuilder 의 reverse() 메소드를 활용하면 훨씬 간단하다.