#include <stdio.h>
typedef unsigned long long huge;
huge min(huge a, huge b) {
return (a<b) ? a : b;
}
huge calc(huge n, huge k){
huge Up=k, Dn=0;
while(Up-Dn>1){
huge Md=(Up+Dn)/2;
huge cnt=0, aux=1;
for(huge i=1; i<=min(n,Md); ++i){
aux*=Md-i+1;
aux/=i;
cnt+=aux;
if(cnt>=k)
break;
}
if(cnt<k)
Dn=Md;
else
Up=Md;
}
return Dn+1;
}
int main(){
huge n,k, ans[1000];
int tot=0;
scanf("%llu %llu",&n,&k);
while(n>0 && k>0){
n=min(60LLU,n);
ans[tot++]=calc(n,k);
scanf("%llu %llu",&n,&k);
}
for(int i=0; i<tot; ++i)
printf("%llu\n",ans[i]);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnR5cGVkZWYgdW5zaWduZWQgbG9uZyBsb25nIGh1Z2U7Cmh1Z2UgbWluKGh1Z2UgYSwgIGh1Z2UgYikgewogICAgcmV0dXJuIChhPGIpID8gIGEgOiBiOwp9IApodWdlIGNhbGMoaHVnZSBuLCBodWdlIGspewogICAgaHVnZSBVcD1rLCBEbj0wOyAKICAgIHdoaWxlKFVwLURuPjEpeyAKICAgICAgICBodWdlIE1kPShVcCtEbikvMjsKICAgICAgICBodWdlIGNudD0wLCAgYXV4PTE7CiAgICAgICAgZm9yKGh1Z2UgaT0xOyBpPD1taW4obixNZCk7ICsraSl7CiAgICAgICAgICAgICAgICBhdXgqPU1kLWkrMTsKICAgICAgICAgICAgICAgIGF1eC89aTsKICAgICAgICAgICAgICAgIGNudCs9YXV4OwogICAgICAgICAgICAgICAgaWYoY250Pj1rKQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgaWYoY250PGspCiAgICAgICAgICAgIERuPU1kOwogICAgICAgICBlbHNlIAogICAgICAgICAgICBVcD1NZDsKICAgICAgICAgfSAKICAgIHJldHVybiBEbisxOyAKICAgIH0KIGludCBtYWluKCl7CiAgICBodWdlIG4saywgYW5zWzEwMDBdOwogICAgaW50IHRvdD0wOwogICAgc2NhbmYoIiVsbHUgJWxsdSIsJm4sJmspOyAKICAgIHdoaWxlKG4+MCAmJiBrPjApewogICAgICAgICBuPW1pbig2MExMVSxuKTsKICAgICAgICAgYW5zW3RvdCsrXT1jYWxjKG4sayk7CiAgICAgICAgIHNjYW5mKCIlbGx1ICVsbHUiLCZuLCZrKTsKICAgICB9CiAgICAgZm9yKGludCBpPTA7IGk8dG90OyArK2kpCiAgICAgICAgIHByaW50ZigiJWxsdVxuIixhbnNbaV0pOwogICAgIHJldHVybiAwOyAKfQ==