#include using namespace std; #define rep(i , a, b) for(int i = a; i < (b) ; ++i) #define all(x) std::begin(x), std::end(x) #define sz(x) ((int) x.size()) typedef long long ll; #define int ll typedef pair pii; typedef vector vi; const ll mod = 1'000'000'007; ll modpow(ll b, ll e) { ll ans = 1; for(;e ; b = b*b%mod,e/=2) { if(e & 1) ans = ans * b % mod; } return ans; } signed main() { cin.tie(0)->sync_with_stdio(0); int vrcholy,edges,queries; cin >> vrcholy >> edges >> queries; vector> next(vrcholy); // desk,mon diff, add Q count vector>> stats(vrcholy); for(auto & [d,cache]:stats) { int k; cin >> k; d-=k; } for(auto & [d, cache]:stats) { int k; cin >> k; d+=k; } for (int i = 0; i < edges; ++i){ int in,to; cin >> in >> to; in --; to --; next[in].push_back(to); next[to].push_back(in); } int addQsCounter = 0; for (int i = 0; i < queries; ++i) { string word; cin >> word; if(word == "check") { int index; cin >> index; index--; auto & [my,cache] = stats[index]; auto & [diff,addQs, sum] = cache; if(addQs == 0 || abs(sum/99) + addQs <= addQsCounter) { sum = my; for(auto nigh:next[index]) { sum += get<0>(stats[nigh]); } addQs = addQsCounter; } if(sum == 0) { cout << "same\n"; } else if(sum > 0) { cout << "monitors\n"; } else { cout << "desks\n"; } } else { addQsCounter ++; int count; string word; int vrchol; cin >> count >> word >> vrchol; vrchol--; if(word == "monitor") { get<0>(stats[vrchol]) += count; } else { get<0>(stats[vrchol]) -= count; } } } cout << flush; return 0; }