#include char a[11], b[11]; int len(char[]); int comp(char, char); int main(void) { scanf("%s %s", a, b); if( len(a) != len(b) ) { printf("%s\n", (len(a) < len(b) ? b : a) ); } else { int i = 0; while( comp(a[i], b[i]) == 0 ) { i++; } printf("%s\n", (comp(a[i], b[i]) == 1 ? b : a) ); } return 0; } int len(char c[]) { int i = 0; while(c[i] != '\0') { i++; } return i; } int comp(char x, char y) { if(x == '7' && y == '4') { return 1; } if(x == '4' && y == '7') { return -1; } if(x == y) { return 0; } return (x < y ? 1 : -1); }