20251128
////#include <stdio.h>
////int memo[100][100]={};
////
////
////int pascal(int r, int c){
////
////
//// if(c==1){
//// return 1;
//// }
//// else if(r==1){
//// return 1;
//// }
//// if(memo[r][c] != 0){
//// return memo[r][c] % 100000000;
//// }
////
////
//// return memo[r][c]=pascal(r,c-1)%100000000+pascal(r-1,c)%100000000;
////
////
////
////}
////
////
////
////
////
////int main()
////
////{
//// int r,c=0;
////
////
////
//// scanf("%d %d",&r, &c);
////
//// printf("%d",pascal(r,c)%100000000);
////
////
////
//// return 0;
////}
#include <stdio.h>
int length=1;
int temp=0;
int memo[100]= {0};
int rec(int n) {
if(n==1) {
// printf("\n");
temp=length;
length=1;
return temp;
}
if(memo[n]!=0) {
return memo[n];
}
if(n%2==0) {
n=n/2;
//printf("%d ",n);
length++;
return memo[n]=rec(n/2);
}
else if(n%2==1) {
n=3*n+1;
//printf("%d ",n);
length++;
return memo[n]=rec(3*n+1);
}
rec(n);
}
int main() {
int a,b;
int i;
int l_l=0;
int l_l_i;
memo[1]=1;
scanf("%d %d",&a,&b);
for(i=a; i<=b; i++) {
if(rec(i)>l_l) {
l_l=rec(i);
l_l_i=i;
}
//else if(rec(i)==l_l) {
// printf("%d ",l_l);
// printf("%d ", l_l_i);
// }
}
printf("%d\n",l_l_i );
printf("%d",l_l);
return 0;
}




