#include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; template T gcd(T a, T b) { if (a < b) swap(a, b); while (b != 0) { T tmp = b; b = a % b; a = tmp; } return a; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; string s; cin >> s; bool f = false; for(char c : s){ if(c == '.') f = true; } if(!f){ cout << s << "/" << 1 << endl; return 0; } ll n = 0; ll d = 1; f = false; for(char c : s){ if(c == '.') { f = true; continue; } if(f){ d *= 10; } n = n*10+(c-'0'); } ll g = gcd(n, d); cout << n/g << '/' << d/g << endl; }