#include<iostream>
using namespace std;

int main(){
	double d;
	while( cin >> d, d>=0.0 ){
		int n = (int)(d*16.0);
		if( (double)n != d*16.0 || (int)d > 256 ){
			cout << "NA" << endl;
			continue;
		}
		for( int i=11; i>=4; i-- ){
			cout << (n&(1<<i) ? '1':'0');
		}
		cout << '.';
		for( int i=3; i>=0; i-- ){
			cout << (n&(1<<i) ? '1':'0');
		}
		cout << endl;
	}
	return 0;
}