#include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define FAST_IO \ ios::sync_with_stdio(false); \ cin.tie(0); const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<998244353>; using namespace std::chrono; int main() { FAST_IO int ys, ms, ds, ye, me, de; cin >> ys >> ms >> ds; cin >> ye >> me >> de; year_month_day from{year(ys), month(ms), day(ds)}; year_month_day to{year(ye), month(me), day(de)}; year_month_day from2 = sys_days(to) + days{1}; auto b = (sys_days(to) - sys_days(from)).count() + 1; int Q; cin >> Q; while (Q--) { int y, m, d; cin >> y >> m >> d; year_month_day to2{year(y), month(m), day(d)}; auto a = (sys_days(to2) - sys_days(from2)).count() + 1; if (a < b) { cout << "Less" << "\n"; } else if (a == b) { cout << "Same" << "\n"; } else { cout << "More" << "\n"; } } }