#include using namespace std; struct frac{ //最終的に分子分母64bitに収まる計算のみ. public: long long n,d; frac() : n(0),d(1){} frac(long long v) : n(v),d(1) {} frac(__int128_t a,__int128_t b,bool redu = true){ assert(b != 0); if(redu) reduce(a,b); n = a,d = b; } private: __int128_t gcd(__int128_t a,__int128_t b){ if(a%b == 0) return b; return gcd(b,a%b); } __int128_t gcd128(__int128_t a,__int128_t b){ //絶対値gcd128. if(b == 0) return abs(a); return gcd(abs(a),abs(b)); } void reduce(__int128_t &a,__int128_t &b){ //約分. if(b < 0) a = -a,b = -b; __int128_t div = gcd128(a,b); a /= div; b /= div; } public: //計算量 O(logmax(d,b.d)). friend frac operator+(const frac &b){return b;} friend frac operator-(const frac &b){return frac(-b.n,b.d,false);} friend frac operator+(const frac &a,const frac &b){ return frac((__int128_t)a.n*b.d+(__int128_t)b.n*a.d,(__int128_t)a.d*b.d); } friend frac operator-(const frac &a,const frac &b){ return frac((__int128_t)a.n*b.d-(__int128_t)b.n*a.d,(__int128_t)a.d*b.d); } friend frac operator*(const frac &a,const frac &b){ long long g1 = std::gcd(a.n,b.d),g2 = std::gcd(a.d,b.n); return frac((a.n/g1)*(b.n/g2),(a.d/g2)*(b.d/g1),false); } friend frac operator/(const frac &a,const frac &b){ assert(b.n != 0); long long g1 = std::gcd(a.n,b.n),g2 = std::gcd(a.d,b.d); if(b.n < 0) return frac((-a.n/g1)*(b.d/g2),(a.d/g2)*(-b.n/g1)); else return frac((a.n/g1)*(b.d/g2),(a.d/g2)*(b.n/g1)); } friend bool operator==(const frac &a,const frac &b){return a.n==b.n && a.d==b.d;} friend bool operator!=(const frac &a,const frac &b){return a.n!=b.n || a.d!=b.d;} friend bool operator>(const frac &a,const frac &b){return (__int128_t)a.n*b.d > (__int128_t)b.n*a.d;} friend bool operator>=(const frac &a,const frac &b){return (__int128_t)a.n*b.d >= (__int128_t)b.n*a.d;} friend bool operator<(const frac &a,const frac &b){return (__int128_t)a.n*b.d < (__int128_t)b.n*a.d;} friend bool operator<=(const frac &a,const frac &b){return (__int128_t)a.n*b.d <= (__int128_t)b.n*a.d;} frac &operator=(const frac &b) = default; frac operator+=(const frac &b){return *this=*this+b;} frac operator-=(const frac &b){return *this=*this-b;} frac operator*=(const frac &b){return *this=*this*b;} frac operator/=(const frac &b){return *this=*this/b;} frac operator++(int){*this += frac(1); return *this;} frac operator--(int){*this -= frac(1); return *this;} double decimal(){return (n+0.0)/d;} long double decimall(){return ((long double)n)/d;} long long num(){return n;} long long den(){return d;} long long floor(){return n<0?(n+1)/d-1:n/d;} long long ceil(){return n>0?(n-1)/d+1:n/d;} frac inv(){return frac(n>=0?d:-d,n>=0?n:-n,false);} }; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int A,B,H,W; cin >> A >> B >> H >> W; frac one = min(H*frac(H,A)*B,frac(W,B)*A*W); swap(A,B); frac two = min(H*frac(H,A)*B,frac(W,B)*A*W); if(one > two) cout << "Non-rotating" << endl; else if(one == two) cout << "Same" << endl; else cout << "Rotating" << endl; }