#include <bits/stdc++.h>
#pragma optimize("no-stack-protector")
using namespace std;
namespace io {
const int L = (1 << 21) + 1;
char ibuf[L], *iS, *iT, obuf[L], *oS = obuf, *oT = obuf + L - 1, c, qu[55];
int f, qr;
inline void flush() {
  fwrite(obuf, 1, oS - obuf, stdout);
  oS = obuf;
}
inline void putc(char x) {
  *oS++ = x;
  if (oS == oT) flush();
}
template <class I>
inline void gi(I &x) {
  for (f = 1, c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                              (iS == iT ? EOF : *iS++))
                            : *iS++);
       c < '0' || c > '9';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    if (c == '-') f = -1;
  for (x = 0; c <= '9' && c >= '0';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    x = x * 10 + (c & 15);
  x *= f;
}
template <class I>
inline void print(I x) {
  if (!x) putc('0');
  if (x < 0) putc('-'), x = -x;
  while (x) qu[++qr] = x % 10 + '0', x /= 10;
  while (qr) putc(qu[qr--]);
}
inline char read() {
  for (c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       c < 'a' || c > 'z';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    ;
  return c;
}
inline void gs(char *s) {
  int l;
  for (c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++);
       c < 'a' || c > 'z';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    ;
  for (l = 0; c <= 'z' && c >= 'a';
       c = (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, L, stdin),
                       (iS == iT ? EOF : *iS++))
                     : *iS++))
    s[l] = c, ++l;
  s[l] = 0;
}
inline void ps(const char *s) {
  int l = strlen(s), i;
  for (i = 0; i < l; i++) putc(s[i]);
}
struct IOC {
  ~IOC() { flush(); }
} _ioc_;
};  // namespace io
using io::gi;
using io::gs;
using io::print;
using io::ps;
using io::putc;
using io::read;
inline int ctz(int a) { return __builtin_ctz(a); }
inline int ctz(unsigned int a) { return __builtin_ctz(a); }
inline int ctz(long long a) { return __builtin_ctzll(a); }
inline int ctz(unsigned long long a) { return __builtin_ctzll(a); }
template <class T>
inline T gcd(T a, T b) {
  int shift = ctz(a | b);
  for (b >>= ctz(b), a >>= ctz(a); a; a -= b, a >>= ctz(a))
    if (a < b) swap(a, b);
  return b << shift;
}
template <class T>
void exgcd(T a, T b, T &x, T &y) {
  if (!b) return (void)(x = 1, y = 0);
  exgcd(b, a % b, y, x), y -= a / b * x;
}
int inv(int a, int p) {
  int x, y;
  exgcd(a, p, x, y);
  return (x % p + p) % p;
}
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <class A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) res += ", ";
    first = false, res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <class A, class... B>
void debug_out(A H, B... T) {
  cerr << " " << to_string(H), debug_out(T...);
}
void scan() {}
template <class A, class... B>
void scan(A &a, B &...b) {
  gi(a), scan(b...);
}
template <class T>
inline bool chkmin(T &a, T b) {
  return b < a ? a = b, true : false;
}
template <class T>
inline bool chkmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
const int N = 1e5 + 5, M = 2e5 + 5;
int n, m, op[M], pos[M], h[M], z[N], id[N];
struct ds {
  vector<int> st, po, vo, ro;
  int n, l, r;
  void init(int _l, int _r) {
    l = _l, r = _r, n = r - l + 1;
    st.resize(n << 1), po.resize(n), vo.resize(n), ro.resize(n);
    for (int i = 0; i < n; i++) po[i] = l + i;
    sort(po.begin(), po.end(), [&](int x, int y) { return z[x] < z[y]; });
    for (int i = 0; i < n; i++) vo[i] = z[po[i]], ro[po[i] - l] = i;
  }
  void modify(int u, int v) {
    for (st[u = ro[u - l] + n] = v; u > 1; u >>= 1) {
      st[u >> 1] = max(st[u], st[u ^ 1]);
    }
  }
  int query(int x) {
    int l = upper_bound(vo.begin(), vo.end(), x) - vo.begin(), r = n - 1,
        ret = 0;
    for (l += n, r += n + 1; l < r; l >>= 1, r >>= 1) {
      if (l & 1) chkmax(ret, st[l++]);
      if (r & 1) chkmax(ret, st[--r]);
    }
    return ret;
  }
} st[N << 2];
void build(int u, int l, int r) {
  st[u].init(l, r);
  if (l < r) {
    int mid = (l + r) >> 1, ls = u << 1, rs = ls | 1;
    build(ls, l, mid), build(rs, mid + 1, r);
  } else
    id[l] = u;
}
int res[N];
set<int> T;
multiset<int> Q;
int query(int u, int l, int r, int s, int t, int v) {
  if (l == s && r == t) return st[u].query(v);
  int ls = u << 1, rs = ls | 1, mid = (l + r) >> 1;
  if (t <= mid) return query(ls, l, mid, s, t, v);
  if (s > mid) return query(rs, mid + 1, r, s, t, v);
  return max(query(ls, l, mid, s, mid, v),
             query(rs, mid + 1, r, mid + 1, t, v));
}
void updval(int u) {
  for (int x = id[u]; x; x >>= 1) st[x].modify(u, res[u]);
}
void update(int x) {
  int past = res[x];
  res[x] = 1;
  if (x < n) res[x] += query(1, 1, n, x + 1, n, z[x]);
  if (res[x] == past) return;
  Q.erase(Q.find(past)), Q.insert(res[x]);
  updval(x);
}
void insert(int x) {
  res[x] = 1;
  if (x < n) res[x] += query(1, 1, n, x + 1, n, z[x]);
  T.insert(x);
  Q.insert(res[x]);
  updval(x);
}
void erase(int x) {
  Q.erase(Q.find(res[x]));
  T.erase(x);
  res[x] = 0;
  updval(x);
}
int main() {
  int i, j, x;
  scan(n, m);
  for (i = 1; i <= m; i++) {
    scan(op[i]), scan(pos[i]);
    if (op[i] == 1) scan(h[i]), h[i] += m - i, z[pos[i]] = h[i];
  }
  build(1, 1, n);
  for (i = 1; i <= m; i++) {
    if (op[i] == 1) {
      insert(pos[i]);
      vector<int> vec;
      for (j = max(i - 10, 1); j < i; j++)
        if (op[j] == 1 && h[j] < h[i] && pos[j] < pos[i] && res[pos[j]] > 0) {
          vec.push_back(pos[j]);
        }
      sort(vec.begin(), vec.end(), [&](int x, int y) { return z[x] > z[y]; });
      for (int w : vec) update(w);
    } else {
      auto it = T.begin();
      for (x = 1; x < pos[i]; x++) ++it;
      int height = z[*it];
      erase(*it);
      it = T.begin();
      vector<int> vec;
      for (x = 1; x < pos[i]; x++) {
        if (z[*it] < height) vec.push_back(*it);
        ++it;
      }
      sort(vec.begin(), vec.end(), [&](int x, int y) { return z[x] > z[y]; });
      for (int w : vec) update(w);
    }
    if (Q.size())
      print(*Q.rbegin());
    else
      print(0);
    putc('\n');
  }
}
