#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define INF 100000000000000000
#define EPS 1e-9
int n,m,k;
set<int> gr[200011];
vector<int> ans;
bool vis[200011];
pii edge[200011];
int32_t main()
{
cin>>n>>m>>k;
int x,y;
for(int i=1;i<=m;i++)
{
cin>>x>>y;
gr[x].insert(y);
gr[y].insert(x);
edge[i] = make_pair(x,y);
}
queue<int> q;
set<int> cango;
for(int i=1;i<=n;i++)
{
//cout<<gr[i].size()<<"\n";
if(gr[i].size() < k)
q.push(i);
else
cango.insert(i);
}
while(!q.empty())
{
int x = q.front();
q.pop();
cango.erase(x);
if(vis[x]) continue;
vis[x]=1;
for(auto c:gr[x])
{
gr[x].erase(c);
gr[c].erase(x);
if(gr[c].size() < k)
{
cango.erase(c);
q.push(c);
}
}
}
ans.pb(cango.size());
//cout<<cango.size()<<"\n";
for(int i=m;i>=2;i--)
{
int a = edge[i].first;
int b = edge[i].second;
if(gr[a].find(b) == gr[a].end())
{
ans.pb(cango.size());
//cout<<cango.size()<<"\n";
continue;
}
if(gr[b].find(a) == gr[b].end())
{
ans.pb(cango.size());
//cout<<cango.size()<<"\n";
continue;
}
q.push(a);
q.push(b);
gr[a].erase(b);
gr[b].erase(a);
//cout<<a<<" "<<b<<"\n";
while(!q.empty())
{
int x = q.front();
q.pop();
if(gr[x].size() >= k) continue;
if(cango.find(x) == cango.end()) continue;
cango.erase(x);
for(auto c:gr[x])
{
gr[x].erase(c);
gr[c].erase(x);
if(gr[c].size() < k)
{
//cango.erase(c);
q.push(c);
}
}
}
ans.pb(cango.size());
//cout<<cango.size()<<"\n";
}
for(int i=ans.size()-1;i>=0;i--)
cout<<ans[i]<<"\n";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBpbnQgbG9uZyBsb25nCiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgZmYgZmlyc3QKI2RlZmluZSBzcyBzZWNvbmQKI2RlZmluZSBwaWkgcGFpcjxpbnQsaW50PgojZGVmaW5lIElORiAxMDAwMDAwMDAwMDAwMDAwMDAKI2RlZmluZSBFUFMgMWUtOQoKaW50IG4sbSxrOwpzZXQ8aW50PiBnclsyMDAwMTFdOwp2ZWN0b3I8aW50PiBhbnM7CmJvb2wgdmlzWzIwMDAxMV07CnBpaSBlZGdlWzIwMDAxMV07CgppbnQzMl90IG1haW4oKQp7CiAgICBjaW4+Pm4+Pm0+Pms7CiAgICBpbnQgeCx5OwogICAgZm9yKGludCBpPTE7aTw9bTtpKyspCiAgICB7CiAgICAgICAgY2luPj54Pj55OwogICAgICAgIGdyW3hdLmluc2VydCh5KTsKICAgICAgICBnclt5XS5pbnNlcnQoeCk7CiAgICAgICAgZWRnZVtpXSA9IG1ha2VfcGFpcih4LHkpOwogICAgfQogICAgcXVldWU8aW50PiBxOwogICAgc2V0PGludD4gY2FuZ287CgogICAgZm9yKGludCBpPTE7aTw9bjtpKyspCiAgICB7CiAgICAgICAgLy9jb3V0PDxncltpXS5zaXplKCk8PCJcbiI7CiAgICAgICAgaWYoZ3JbaV0uc2l6ZSgpIDwgaykKICAgICAgICAgICAgcS5wdXNoKGkpOwogICAgICAgIGVsc2UKICAgICAgICAgICAgY2FuZ28uaW5zZXJ0KGkpOwogICAgfQoKICAgIHdoaWxlKCFxLmVtcHR5KCkpCiAgICB7CiAgICAgICAgaW50IHggPSBxLmZyb250KCk7CgogICAgICAgIHEucG9wKCk7CgogICAgICAgIGNhbmdvLmVyYXNlKHgpOwoKICAgICAgICBpZih2aXNbeF0pIGNvbnRpbnVlOwoKICAgICAgICB2aXNbeF09MTsKICAgICAgICBmb3IoYXV0byBjOmdyW3hdKQogICAgICAgIHsKICAgICAgICAgICAgZ3JbeF0uZXJhc2UoYyk7CiAgICAgICAgICAgIGdyW2NdLmVyYXNlKHgpOwogICAgICAgICAgICBpZihncltjXS5zaXplKCkgPCBrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBjYW5nby5lcmFzZShjKTsKICAgICAgICAgICAgICAgIHEucHVzaChjKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGFucy5wYihjYW5nby5zaXplKCkpOwogICAgLy9jb3V0PDxjYW5nby5zaXplKCk8PCJcbiI7CgogICAgZm9yKGludCBpPW07aT49MjtpLS0pCiAgICB7CiAgICAgICAgaW50IGEgPSBlZGdlW2ldLmZpcnN0OwogICAgICAgIGludCBiID0gZWRnZVtpXS5zZWNvbmQ7CgogICAgICAgIGlmKGdyW2FdLmZpbmQoYikgPT0gZ3JbYV0uZW5kKCkpCiAgICAgICAgewogICAgICAgICAgICBhbnMucGIoY2FuZ28uc2l6ZSgpKTsKICAgICAgICAgICAgLy9jb3V0PDxjYW5nby5zaXplKCk8PCJcbiI7CiAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgIH0KCiAgICAgICAgaWYoZ3JbYl0uZmluZChhKSA9PSBncltiXS5lbmQoKSkKICAgICAgICB7CiAgICAgICAgICAgIGFucy5wYihjYW5nby5zaXplKCkpOwogICAgICAgICAgICAvL2NvdXQ8PGNhbmdvLnNpemUoKTw8IlxuIjsKICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgfQoKICAgICAgICBxLnB1c2goYSk7CiAgICAgICAgcS5wdXNoKGIpOwoKICAgICAgICBnclthXS5lcmFzZShiKTsKICAgICAgICBncltiXS5lcmFzZShhKTsKCiAgICAgICAgLy9jb3V0PDxhPDwiICI8PGI8PCJcbiI7CiAgICAgICAgd2hpbGUoIXEuZW1wdHkoKSkKICAgICAgICB7CiAgICAgICAgICAgIGludCB4ID0gcS5mcm9udCgpOwogICAgICAgICAgICBxLnBvcCgpOwogICAgICAgICAgICBpZihnclt4XS5zaXplKCkgPj0gaykgY29udGludWU7CgogICAgICAgICAgICBpZihjYW5nby5maW5kKHgpID09IGNhbmdvLmVuZCgpKSBjb250aW51ZTsKCiAgICAgICAgICAgIGNhbmdvLmVyYXNlKHgpOwoKICAgICAgICAgICAgZm9yKGF1dG8gYzpnclt4XSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgZ3JbeF0uZXJhc2UoYyk7CiAgICAgICAgICAgICAgICBncltjXS5lcmFzZSh4KTsKCiAgICAgICAgICAgICAgICBpZihncltjXS5zaXplKCkgPCBrKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgIC8vY2FuZ28uZXJhc2UoYyk7CiAgICAgICAgICAgICAgICAgICAgcS5wdXNoKGMpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGFucy5wYihjYW5nby5zaXplKCkpOwogICAgICAgIC8vY291dDw8Y2FuZ28uc2l6ZSgpPDwiXG4iOwogICAgfQoKICAgIGZvcihpbnQgaT1hbnMuc2l6ZSgpLTE7aT49MDtpLS0pCiAgICAgICAgY291dDw8YW5zW2ldPDwiXG4iOwogICAgcmV0dXJuIDA7Cn0=