#include<bits/stdc++.h>
using namespace std;

const int KASU=52;
const int SISU=12;
using ll=long long;
using Float=pair<int,ll>;
void output(Float f){
    cout<<bitset<SISU>(f.first)<<bitset<KASU>(f.second)<<endl;
}

Float solve(ll n,ll b,Float sum){
    if(n==0) return sum;
    
    ll x=((1LL<<KASU)+b)>>sum.first;
    if(x==0) return sum;
    ll v=(1LL<<(KASU+1));
    sum.second+=(1LL<<KASU);
    ll c=(v-sum.second-1)/x;
    if(n<=c){
        sum.second+=x*n;
        sum.second-=(1LL<<KASU);
        return sum;
    }    
    else{
        sum.second+=x*(c+1);
        sum.first++;
        sum.second>>=1;
        sum.second-=(1LL<<KASU);
        n-=c+1;
        return solve(n,b,sum);
    }
}

int main(){
    ll n;
    while(cin>>n,n){
        bitset<KASU> tmp;
        cin>>tmp;
        Float f;
        f.first=0;
        f.second=tmp.to_ulong();
        auto ret=solve(n,f.second,f);
        output(ret);
    }
    return 0;
}
