#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 0) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL sum = a;
    LL res = 1;
    while(b){
        if(b&1){
            res = (res * sum)%MOD;
        }
        sum = (sum * sum) % MOD;
        b>>=1;
    }
    return res;
}

class floating{
    public:
        int ex;
        LL num;
        floating(string str){
            ex=0;
            num=0;
            REP(i, str.size()){
                num*=2;
                num+=str[i]-'0';
            }
        }
        floating(){
            ex=num=0;
        }
};

floating operator+(floating a, floating b){
    floating res;
    a.num|=(LL)1<<52;
    b.num|=(LL)1<<52;
    if(a.ex < b.ex)swap(a, b);
    b.num >>= a.ex - b.ex;
    res.ex=a.ex;
    res.num=a.num+b.num;
    if(res.num>>53){
        ++res.ex;
        res.num>>=1;
    }
    res.num^=(LL)1<<52;
    return res;
}

string tostring(floating a){
    string res = "";
    REP(i, 52){
        res += a.num & ((LL)1<<i) ? "1" : "0";
    }
    REP(i, 12){
        res += a.ex & ((LL)1<<i) ? "1" : "0";
    }
    reverse(ALL(res));
    return res;
}

LL toLL(string str){
    LL res = 0;
    foreach(i, str){
        res<<=1;
        res+=i-'0';
    }
    return res;
}

int main(){
    LL n;
    while(cin>>n&&n){
        string str;
        cin >> str;
        str = "1" + str;
        int count = 0;
        LL sum = toLL(str);
        LL add = toLL(str);
        while(true){
            if(add==0)break;
            LL d = (((LL)1<<53) - sum + add - 1) / add;
            if(d>n){
                sum += add * n;
                break;
            }else if(d==n){
                sum += add * d;
                sum >>= 1;
                ++count;
                break;
            }else{
                sum += add * d;
                n -= d;
                sum >>= 1;
                add >>= 1;
                ++count;
            }
        }
        floating a;
        a.ex = count;
        a.num = sum ^ ((LL)1<<52);
        cout << tostring(a) << endl;
    }
}

