/** author: shobonvip created: 2025.12.12 21:59:48 **/ #include using namespace std; //* ATCODER #include using namespace atcoder; typedef modint998244353 mint; //*/ /* BOOST MULTIPRECISION #include using namespace boost::multiprecision; //*/ typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) #define all(v) v.begin(), v.end() template bool chmin(T &a, const T &b) { if (a <= b) return false; a = b; return true; } template bool chmax(T &a, const T &b) { if (a >= b) return false; a = b; return true; } template T max(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]); return ret; } template T min(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]); return ret; } template T sum(vector &a){ T ret = 0; for (int i=0; i<(int)a.size(); i++) ret += a[i]; return ret; } vector days_of_month_raw = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; bool is_leap(int year) { if (year % 4 == 0) { if (year % 100 == 0) { if (year % 400 == 0) { return true; } return false; } return true; } return false; } int days_of_month(int year, int month) { assert(1 <= month && month <= 12); if (month == 2) { if (is_leap(year)) { return 29; } else { return 28; } } else { return days_of_month_raw[month]; } } const int mx_year = 2026; vector rui_days_of_year(mx_year + 1); struct dates { int year, month, day; }; int date_to_num(dates s) { int ret = rui_days_of_year[s.year]; for (int i=1; i> ys >> ms >> ds; cin >> ye >> me >> de; int kessei = date_to_num(dates{ys, ms, ds}); int kaimei = date_to_num(dates{ye, me, de}) + 1; int q; cin >> q; while (q--) { int y, m, d; cin >> y >> m >> d; int now = date_to_num(dates{y, m, d}) + 1; if (kaimei - kessei > now - kaimei) { cout << "Less\n"; } else if (kaimei - kessei < now - kaimei) { cout << "More\n"; } else { cout << "Same\n"; } } }