cin >> n >> m >> q; int N = sqrt(2 * m); for (int i = 1; i <= m; ++i) { int x, y; cin >> x >> y; ++du[x]; ++du[y]; A[x].push_back(y); A[y].push_back(x); } for (int u = 1; u <= n; ++u) { if (du[u] > N) id[u] = ++cnt; for (auto v : A[u]) if (du[v] > N) B[u].push_back(v); } for (int i = 1; i <= q; ++i) { int u, w; cin >> u >> w; a[u] += w; if (du[u] <= N) { bool ok = 1; for (auto v : A[u]) { if (du[v] > N) mx[v] = max(mx[v], a[u]); if (a[v] > a[u]) ok = 0; else ok &= !(a[v] == a[u]), update(v, i); } if (ok) { for (auto v : B[u]) C[id[v]][a[u]].push_back(u); if (!champion[u]) champion[u] = i; } } else { bool ok = 1; for (auto v : B[u]) { if (a[v] > a[u]) ok = 0; else ok &= !(a[v] == a[u]), update(v, i); } for (int k = a[u] - w + 1; k <= a[u]; ++k) for (auto v : C[id[u]][k]) if (a[v] == k) update(v, i); if (ok && mx[u] < a[u] && !champion[u]) champion[u] = i; } } for (int i = 1; i <= n; ++i) if (champion[i]) ans[i] += q - champion[i]; for (int i = 1; i <= n; ++i) cout << ans[i] << "\n"; return0; }