#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; int gcd(int a, int b){return (b==0?a:gcd(b,a%b));} int lcm(int a, int b){return a/gcd(a,b)*b;} bool solve3(ll T1, ll T2, ll T3, ll v, ll x){ double d1 = v/(double)x/(double)T1; double d2 = v/(double)x/(double)T2; double d3 = v/(double)x/(double)T3; d1 -= (int)(d1); if(d1>0.5) d1 = 1.0-d1; d2 -= (int)(d2); if(d2>0.5) d2 = 1.0-d2; d3 -= (int)(d3); if(d3>0.5) d3 = 1.0-d3; //cout << x << " " << d1 << " " << d2 << " " << d3 << endl; if(fabs(d1-d2)<1e-9 && fabs(d2-d3)<1e-9) return true; return false; } bool solve2(ll T1, ll T2, ll v, ll x){ double d1 = v/(double)x/(double)T1; double d2 = v/(double)x/(double)T2; d1 -= (int)(d1); if(d1>0.5) d1 = 1.0-d1; d2 -= (int)(d2); if(d2>0.5) d2 = 1.0-d2; if(fabs(d1-d2)<1e-9) return true; return false; } vector divisor(int n){ vector ret; for(ll i=1; i*i<=n; i++){ if(n%i==0){ ret.push_back(i); if(i!=n/i) ret.push_back(n/i); } } sort(ret.begin(), ret.end()); reverse(ret.begin(), ret.end()); return ret; } int main(){ ll T1, T2, T3; cin >> T1; cin >> T2; cin >> T3; ll v = lcm(T1, lcm(T2, T3)); ll x = 0; for(ll i=v-1; i>0; i--){ if(solve2(T1, T2, v, i)){ x = i; break; } } vector div = divisor(x); rep(i,div.size()){ if(solve3(T1, T2, T3, v, div[i])){ cout << v << "/" << div[i] << endl; return 0; } } return 0; }