# -*- coding: utf-8 -*- A,B = input().split() if len(A) > len(B): print(A) elif len(A) < len(B): print(B) else: for a,b in zip(A,B): a = int(a) b = int(b) if a==7 and b==4: print(B) break elif a==4 and b==7: print(A) break else: if a > b: print(A) break elif a < b: print(B) break else: continue