#include<bits/stdc++.h>
using namespace std;
#define fir first
#define sec second
const int N=2e5+10;
typedef pair<int, int> pii;
pii e[N];
set<int> G[N];
bool removed[N];
int deg[N], ans[N], k;
set<int> s;
set<int>::iterator it;
void _remove(int u){
queue<int> q;
q.push(u);
while(!q.empty()){
int u=q.front(); q.pop();
s.insert(u);
//cout<<u<<endl;
removed[u]=true;
for(it=G[u].begin(); it!=G[u].end();){
int v=*it;
it++;//一定要自行++,因为erase之后it指针置空
if(removed[v]) continue;
G[v].erase(u);
G[u].erase(v);
deg[v]--;
if(deg[v]<k)
q.push(v);
}
}
}
int main(){
int n, m;
scanf("%d%d%d", &n, &m, &k);
for(int i=1; i<=m; i++){
scanf("%d%d", &e[i].fir, &e[i].sec);
G[e[i].fir].insert(e[i].sec);
G[e[i].sec].insert(e[i].fir);
deg[e[i].fir]++; deg[e[i].sec]++;
}
for(int i=1; i<=n; i++){
if(deg[i]<k && !removed[i]){
_remove(i);
}
}
ans[m]=n-s.size();
for(int i=m; i>1; i--){
int u=e[i].fir, v=e[i].sec;
if(!removed[u] && !removed[v]){
deg[u]--; deg[v]--;
G[u].erase(v); G[v].erase(u);
if(deg[u]<k) _remove(u);
if(deg[v]<k) _remove(v);
}
ans[i-1]=n-s.size();
}
for(int i=1; i<=m; i++)
printf("%d\n", ans[i]);
return 0;
}