#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#define ll long long
using namespace std;
const int maxn=110;

ll n;



int main() {
    //freopen("a.out", "w", stdout);
    while(scanf("%lld",&n)&&n) {
        ll a=0;
        string s;
        cin>>s;
        for(int i=0;i<s.size();++i) {
            a<<=1;
            a+=s[i]-'0';
        }
        a+=1ll<<52;
        ll e=0,ans=a;
        while(n) {
            ll t=((1ll<<53)-1-ans)/a+1;
            if(t>n) {
                ans+=n*a;
                break;
            }
            else {
                ans+=t*a;
                ++e;
                ans>>=1;
                a>>=1;
                if(!a) break;
                n-=t;
            }
        }
        for(int i=11;i>=0;--i) {
            cout<<(((1ll<<i)&e)?1:0);
        }
        for(int i=51;i>=0;--i) {
            cout<<(((1ll<<i)&ans)?1:0);
        }
        cout<<'\n';
    }
}


/*
100 1100101


*/
