#include <iostream>
#include <vector>
#include <algorithm>
#include <bitset>
#include <utility>
#include <cmath>
using namespace std;
typedef long long int lli;

//Floating Point Numbers
struct fpn{
	lli sgn;
	lli exp;
	fpn(lli s, lli e):sgn(s),exp(e){}
	fpn(bitset<64> f){
		sgn = (f.to_ullong() & ((1ULL<<52)-1)) | (1ULL << 52);
		exp = f.to_ullong() >> 52;
	}
	fpn add(fpn a){
		fpn b = *this;
		if(a.exp > b.exp) swap(a, b);
		a.sgn >>= (b.exp -a.exp);
		sgn = a.sgn +b.sgn;
		exp = b.exp;
		if(sgn>>53 & 1){
			sgn >>= 1;
			exp++;
		}
		return *this;
	}
	fpn times(lli n){
		fpn a = *this;
		fpn ret = fpn(0, 0);
		for(int i=0; i<64; i++){
			if(n>>i & 1) ret.add(a);
			a.exp++;
		}
		*this = ret;
		return *this;
	}
	lli rem_addition(fpn a){
		a.sgn >>= (exp -a.exp);
		if(a.sgn == 0) return -1;
		return ((1LL<<53) -sgn) /a.sgn;
	}
	bitset<64> to_bitset(){
		return bitset<64>(exp<<52 | (sgn^1LL<<52));	
	}
	double to_double(){
		return (double)sgn*pow(2, exp-52);
	}
};

int main(){
	while(1){
		lli n;
		cin >> n;
		if(n==0) break;

		bitset<64> bit;
		cin >> bit;
		fpn a(bit);
		fpn s = a;
		while(n>0){
			lli rem = s.rem_addition(a);
			if(rem == -1) break;
			if(rem > n) rem = n;
			if(rem == 0) rem = 1;
			fpn tmp = a;
			tmp.sgn &= ~((1LL<<(s.exp -tmp.exp))-1);
			tmp.times(rem);
			s.add(tmp);
			n -= rem;
		}
		cout << s.to_bitset() << endl;
	}
    return 0;
}
