#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>; #include int main() { FAST_IO int ys, ms, ds, ye, me, de; cin >> ys >> ms >> ds; cin >> ye >> me >> de; tm ts { 0 }, te { 0 }; ts.tm_year = ys - 1900; ts.tm_mon = ms - 1; ts.tm_mday = ds; te.tm_year = ye - 1900; te.tm_mon = me - 1; te.tm_mday = de; auto tts = mktime(&ts); auto tte = mktime(&te); int day = 24 * 60 * 60; int Q; cin >> Q; while (Q--) { int y, m, d; cin >> y >> m >> d; tm t { 0 }; t.tm_year = y - 1900; t.tm_mon = m - 1; t.tm_mday = d; auto tt = mktime(&t); auto b = tte - tts + day; auto a = tt - tte; b /= day; a /= day; if (a < b) { cout << "Less" << "\n"; } else if (a == b) { cout << "Same" << "\n"; } else { cout << "More" << "\n"; } } }