#include <bits/stdc++.h>
using namespace std;
int INF = (int)1e9;
long long INFINF = (long long)1e18 + 10;
const long double PI = 3.14159265358979323846;
long long powermodm(long long x, long long n, long long mod) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = (x * x) % mod;
    n = n / 2;
  }
  return result;
}
long long GCD(long long, long long);
long long LCM(long long, long long);
long long power(int, int);
long long choose(long long, long long);
int ones(long long);
void extendedEuclid(long long, long long);
long long MMI(long long, long long);
void fastscan(int &);
set<int> adj[200005];
vector<int> degree(200005);
vector<int> a1(200005);
vector<int> b1(200005);
vector<pair<int, int> > pair1;
set<pair<int, int> > set1;
vector<int> vis(200005);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> ans;
  for (long long i = 0; i < m; i++) {
    cin >> a1[i] >> b1[i];
    degree[a1[i]]++;
    degree[b1[i]]++;
    adj[a1[i]].insert(b1[i]);
    adj[b1[i]].insert(a1[i]);
  }
  for (long long i = 0; i < n; i++) {
    set1.insert({degree[i + 1], i + 1});
  }
  for (int i = m - 1; i >= 0; i--) {
    while (!set1.empty()) {
      pair<int, int> temppair;
      temppair = *set1.begin();
      if (temppair.first < k) {
        int temp = temppair.second;
        vis[temp] = 1;
        degree[temp]--;
        set1.erase(temppair);
        for (auto k = adj[temp].begin(); k != adj[temp].end(); k++) {
          set1.erase({degree[*k], *k});
          degree[*k]--;
          if (vis[*k] == 0) {
            set1.insert({degree[*k], *k});
          }
        }
        adj[temp].clear();
      } else {
        break;
      }
    }
    ans.push_back(set1.size());
    set1.erase({degree[a1[i]], a1[i]});
    set1.erase({degree[b1[i]], b1[i]});
    adj[a1[i]].erase(b1[i]);
    adj[b1[i]].erase(a1[i]);
    if (vis[a1[i]] == 0) {
      degree[b1[i]]--;
    }
    if (vis[b1[i]] == 0) {
      degree[a1[i]]--;
    }
    if (vis[a1[i]] == 0) {
      set1.insert({degree[a1[i]], a1[i]});
    }
    if (vis[b1[i]] == 0) {
      set1.insert({degree[b1[i]], b1[i]});
    }
  }
  reverse(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
  return (max(a, b) / GCD(a, b)) * min(a, b);
}
long long power(int a, int n) {
  unsigned long long int result = 1, x = a;
  while (n > 0) {
    if (n % 2 == 1) result = result * x;
    x = x * x;
    n = n / 2;
  }
  return result;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
int ones(long long n) {
  int c = 0;
  while (n) {
    n = n & (n - 1);
    c++;
  }
  return c;
}
long long d, x, y;
void extendedEuclid(long long A, long long B) {
  if (B == 0) {
    d = A;
    x = 1;
    y = 0;
  } else {
    extendedEuclid(B, A % B);
    int temp = x;
    x = y;
    y = temp - (A / B) * y;
  }
}
long long MMI(long long a, long long p) {
  extendedEuclid(a, p);
  if (d == 1 && p != 1)
    return ((x % p) + p) % p;
  else
    return -1;
}
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}

### Prompt

In CPP, your task is to solve the following problem:

There are n persons who initially don't know each other. On each morning, two of them, who were not friends before, become friends.

We want to plan a trip for every evening of m days. On each trip, you have to select a group of people that will go on the trip. For every person, one of the following should hold: 

  * Either this person does not go on the trip, 
  * Or at least k of his friends also go on the trip. 



Note that the friendship is not transitive. That is, if a and b are friends and b and c are friends, it does not necessarily imply that a and c are friends.

For each day, find the maximum number of people that can go on the trip on that day.

Input

The first line contains three integers n, m, and k (2 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ m ≤ 2 ⋅ 10^5, 1 ≤ k < n) — the number of people, the number of days and the number of friends each person on the trip should have in the group.

The i-th (1 ≤ i ≤ m) of the next m lines contains two integers x and y (1≤ x, y≤ n, x≠ y), meaning that persons x and y become friends on the morning of day i. It is guaranteed that x and y were not friends before.

Output

Print exactly m lines, where the i-th of them (1≤ i≤ m) contains the maximum number of people that can go on the trip on the evening of the day i.

Examples

Input

4 4 2
2 3
1 2
1 3
1 4


Output

0
0
3
3


Input

5 8 2
2 1
4 2
5 4
5 2
4 3
5 1
4 1
3 2


Output

0
0
0
3
3
4
4
5


Input

5 7 2
1 5
3 2
2 5
3 4
1 2
5 3
1 3


Output

0
0
0
0
3
4
4

Note

In the first example, 

  * 1,2,3 can go on day 3 and 4. 



In the second example, 

  * 2,4,5 can go on day 4 and 5. 
  * 1,2,4,5 can go on day 6 and 7. 
  * 1,2,3,4,5 can go on day 8. 



In the third example, 

  * 1,2,5 can go on day 5. 
  * 1,2,3,5 can go on day 6 and 7. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int INF = (int)1e9;
long long INFINF = (long long)1e18 + 10;
const long double PI = 3.14159265358979323846;
long long powermodm(long long x, long long n, long long mod) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % mod;
    x = (x * x) % mod;
    n = n / 2;
  }
  return result;
}
long long GCD(long long, long long);
long long LCM(long long, long long);
long long power(int, int);
long long choose(long long, long long);
int ones(long long);
void extendedEuclid(long long, long long);
long long MMI(long long, long long);
void fastscan(int &);
set<int> adj[200005];
vector<int> degree(200005);
vector<int> a1(200005);
vector<int> b1(200005);
vector<pair<int, int> > pair1;
set<pair<int, int> > set1;
vector<int> vis(200005);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> ans;
  for (long long i = 0; i < m; i++) {
    cin >> a1[i] >> b1[i];
    degree[a1[i]]++;
    degree[b1[i]]++;
    adj[a1[i]].insert(b1[i]);
    adj[b1[i]].insert(a1[i]);
  }
  for (long long i = 0; i < n; i++) {
    set1.insert({degree[i + 1], i + 1});
  }
  for (int i = m - 1; i >= 0; i--) {
    while (!set1.empty()) {
      pair<int, int> temppair;
      temppair = *set1.begin();
      if (temppair.first < k) {
        int temp = temppair.second;
        vis[temp] = 1;
        degree[temp]--;
        set1.erase(temppair);
        for (auto k = adj[temp].begin(); k != adj[temp].end(); k++) {
          set1.erase({degree[*k], *k});
          degree[*k]--;
          if (vis[*k] == 0) {
            set1.insert({degree[*k], *k});
          }
        }
        adj[temp].clear();
      } else {
        break;
      }
    }
    ans.push_back(set1.size());
    set1.erase({degree[a1[i]], a1[i]});
    set1.erase({degree[b1[i]], b1[i]});
    adj[a1[i]].erase(b1[i]);
    adj[b1[i]].erase(a1[i]);
    if (vis[a1[i]] == 0) {
      degree[b1[i]]--;
    }
    if (vis[b1[i]] == 0) {
      degree[a1[i]]--;
    }
    if (vis[a1[i]] == 0) {
      set1.insert({degree[a1[i]], a1[i]});
    }
    if (vis[b1[i]] == 0) {
      set1.insert({degree[b1[i]], b1[i]});
    }
  }
  reverse(ans.begin(), ans.end());
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
  return (max(a, b) / GCD(a, b)) * min(a, b);
}
long long power(int a, int n) {
  unsigned long long int result = 1, x = a;
  while (n > 0) {
    if (n % 2 == 1) result = result * x;
    x = x * x;
    n = n / 2;
  }
  return result;
}
long long choose(long long n, long long k) {
  if (k == 0) return 1;
  return (n * choose(n - 1, k - 1)) / k;
}
int ones(long long n) {
  int c = 0;
  while (n) {
    n = n & (n - 1);
    c++;
  }
  return c;
}
long long d, x, y;
void extendedEuclid(long long A, long long B) {
  if (B == 0) {
    d = A;
    x = 1;
    y = 0;
  } else {
    extendedEuclid(B, A % B);
    int temp = x;
    x = y;
    y = temp - (A / B) * y;
  }
}
long long MMI(long long a, long long p) {
  extendedEuclid(a, p);
  if (d == 1 && p != 1)
    return ((x % p) + p) % p;
  else
    return -1;
}
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}

```