#include <iostream>
#include <string>
using namespace std;

int main(){
	double n;
	double b[12] = {128,64,32,16,8,4,2,1,0.5,0.25, 0.125,0.0625};
	while( cin >> n , n != -1.0 ){
		string s;
		for(int i=0 ; i < 12 ; i++ ){
			if( n >= b[i] ){
				n -= b[i];
				s += "1";
			}else{
				s += "0";
			}
			if( i == 7 )
				s += ".";
		}
		if( n > 0 )
			cout << "NA" << endl;
		else
			cout << s << endl;
	}
}