#include "bits/stdc++.h" struct Lab { int desks; int monitors; std::vector neighbours; Lab() {} }; int main() { int N, M, Q; std::cin >> N >> M >> Q; std::vector labs(N); for (int i = 0; i < N; ++i) { std::cin >> labs[i].desks; } for (int i = 0; i < N; ++i) { std::cin >> labs[i].monitors; } 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 < 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; } else if (desk_monitor == "monitor") { labs[label].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 = 0; int total_monitors = 0; total_desks += labs[label].desks; total_monitors += labs[label].monitors; for (int neighbour : labs[label].neighbours) { total_desks += labs[neighbour].desks; total_monitors += labs[neighbour].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; }