#include<bits/stdc++.h> using namespace std; #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr) #define INF 0x7fffffff #define inf 0x3f3f3f3f #define PII pair<int,int> #define endl '\n' #define int long long #define mod 998244353 #define MOD 1e9+7 int read() { char act = 0; int f = 1, x = 0; while (act = getchar(), act < '0' && act != '-'); if (act == '-') f = -1, act = getchar(); x = act - '0'; while (act = getchar(), act >= '0') x = x * 10 + act - '0'; return x * f; } int quick_pow(int base, int pow){ int res=1; while(pow){ if(pow&1)res*=base; base*=base; pow>>=1; } return res; } void solve() { //暴力拆解 string s; cin >> s; int n; cin >> n; vector<string>a; while (s.find('.') != -1) { int pos = s.find('.'); string temp = s.substr(0, pos); a.push_back(temp); s = s.substr(pos + 1); } a.push_back(s); string ans = ""; for (auto i : a) { int temp = stol(i); string tt = ""; while (temp) { int x = temp % 2; string ss = to_string(x); tt += ss; temp /= 2; } reverse(tt.begin(), tt.end()); if(s.size()<8){ int cnt=8-tt.size(); for(int i=1;i<=cnt;i++){ tt="0"+tt; } } //cout<<tt<<endl; ans += tt; } int sum=0; //cout<<ans<<endl; reverse(ans.begin(),ans.end()); for(int i=0;i<ans.size();i++){ if(ans[i]=='0')continue; sum+=quick_pow(2,i); } cout<<sum<<endl; string res=""; while(n){ res+=to_string(n%2); n/=2; } reverse(res.begin(),res.end()); if(res.size()<32){ int cnt=32-res.size(); for(int i=1;i<=cnt;i++){ res="0"+res; } } string s1,s2,s3,s4; s1=res.substr(0,8); s2=res.substr(8,8); s3=res.substr(16,8); s4=res.substr(24); //cout<<s1<<" "<<s2<<" "<<s3<<" "<<s4<<endl; vector<int>num(5,0); reverse(s1.begin(),s1.end()); reverse(s2.begin(),s2.end()); reverse(s3.begin(),s3.end()); reverse(s4.begin(),s4.end()); for(int i=0;i<8;i++){ if(s1[i]=='1')num[1]+=quick_pow(2,i); if(s2[i]=='1')num[2]+=quick_pow(2,i); if(s3[i]=='1')num[3]+=quick_pow(2,i); if(s4[i]=='1')num[4]+=quick_pow(2,i); } for(int i=1;i<=4;i++){ if(i!=4)cout<<num[i]<<"."; else cout<<num[i]<<endl; } } signed main() { IOS; int t = 1; //cin>>t; while (t--) { solve(); } return 0; }