#include using namespace std; #include using namespace atcoder; using ll = long long; using P = pair; ll H,W; ll A,B; P calc(ll x,ll y){ if(x>y){ return {y*H*H,x}; } return {x*W*W,y}; } void solve(){ P l = calc(A,B); P r = calc(B,A); if(l.first*r.second==l.second*r.first){ cout<<"Same"<> A >> B; cin >> H >> W; if(H>W){ swap(H,W); swap(A,B); } solve(); }