import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1];
    auto K = s[2];
    auto G = new bool[int][](N);
    auto D = new int[](N);
    auto Q = new Tuple!(int, int)[](M);
    foreach (i; 0..M) {
        s = readln.split.map!(to!int);
        G[s[0]-1][s[1]-1] = true;
        G[s[1]-1][s[0]-1] = true;
        D[s[0]-1] += 1;
        D[s[1]-1] += 1;
        Q[i] = tuple(s[0]-1, s[1]-1);
    }

    int sm = N;
    auto valid = new bool[](N);
    fill(valid, true);

    void dfs(int n) {
        if (!valid[n]) return;
        valid[n] = false;
        sm -= 1;
        foreach (m; G[n].keys) {
            if (!G[n][m]) continue;
            D[m] -= 1;
            G[n][m] = false;
            G[m][n] = false;
            if (valid[m] && D[m] < K) {
                dfs(m);
            }
        }
    }

    foreach (i; 0..N) {
        if (D[i] < K) dfs(i);
    }

    int[] ans;
    foreach_reverse (q; Q) {
        ans ~= sm;
        int u = q[0];
        int v = q[1];
        if (!valid[u] || !valid[v]) continue;
        D[u] -= 1;
        D[v] -= 1;
        G[u][v] = false;
        G[v][u] = false;
        if (valid[u] && D[u] < K) dfs(u);
        if (valid[v] && D[v] < K) dfs(v);
    }

    ans.reverse();
    ans.each!writeln;
}
