#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    double X;
    double nisin[12]={128,64,32,16,8,4,2,1,0.5,0.25,0.125,0.0625};
    while(cin>>X){
        X+=0.00000001;
        if(X<0)break;
        int check[12]={0};
        for(int i=0;i<12;i++){
            if(X>nisin[i]){
                //printf("[%d]",i);
                X-=nisin[i];
                check[i]=1;
            }
        }
        if(fabs(X)<0.000001){
            for(int i=0;i<12;i++){
                cout<<check[i];
                if(i==7)cout<<'.';
            }
            puts("");
        }
        else puts("NA");
    }
    return 0;
}