https://www.acmicpc.net/problem/2908
import java.util.Scanner;
public class Main {
static int change(int n){
int a=n/100;
int b=(n%100)/10;
int c=n%10;
return c*100+b*10+a;
}
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int m=s.nextInt();
if(change(n)>=change(m)) System.out.format("%d",change(n));
else System.out.format("%d",change(m));
}
}