#include "bits/stdc++.h" struct Lab { int desks; int monitors; std::vector neighbours; }; int main() { int N, M, Q; std::cin >> N >> M >> Q; std::vector labs(N); std::vector desks(N); std::vector monitors(N); for (int i = 0; i < N; ++i) { std::cin >> desks[i]; } for (int i = 0; i < N; ++i) { std::cin >> monitors[i]; } for (int i = 0; i < M; ++i) { int a, b; std::cin >> a >> b; a--; b--; labs[a].neighbours.push_back(b); labs[b].neighbours.push_back(a); } for (int i = 0; i < N; ++i) { labs[i].desks += desks[i]; labs[i].monitors += monitors[i]; for (int neighbour : labs[i].neighbours) { labs[neighbour].desks += desks[i]; labs[neighbour].monitors += monitors[i]; } } for (int i = 0; i < Q; ++i) { std::string type; std::cin >> type; if (type == "add") { int count; std::string desk_monitor; int label; std::cin >> count >> desk_monitor >> label; label--; if (desk_monitor == "desk") { labs[label].desks += count; for (int neighbour : labs[label].neighbours) { labs[neighbour].desks += count; } } else if (desk_monitor == "monitor") { labs[label].monitors += count; for (int neighbour : labs[label].neighbours) { labs[neighbour].monitors += count; } } else { throw std::invalid_argument("tohle by se nemelo stat"); } } else if (type == "check") { int label; std::cin >> label; label--; int total_desks = labs[label].desks; int total_monitors = labs[label].monitors; if (total_desks > total_monitors) { std::cout << "desks" << std::endl; } else if (total_desks < total_monitors) { std::cout << "monitors" << std::endl; } else { std::cout << "same" << std::endl; } } else { throw std::invalid_argument("co"); } } return 0; }