#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>
#include <limits>
#include <functional>

template <class Tp, class Fn>
class range_query {
  static constexpr size_t B = 512;
  std::vector<std::vector<Tp>> bucket;
  std::vector<Tp> summary;
  std::vector<bool> buffered;
  Fn fn;

  void resolve(size_t i) {
    if (!buffered[i]) return;

    buffered[i] = false;
    for (size_t j=0; j<B; ++j)
      bucket[i][j] = summary[i];
  }

public:
  range_query(size_t n, const Tp& val=Tp()):
    bucket((n+B-1)/B, std::vector<Tp>(B, val)), summary((n+B-1)/B, val),
    buffered((n+B-1)/B)
  {}

  void update(const Tp& val, size_t lb, size_t ub) {
    size_t i_lb = lb / B;
    size_t i_ub = ub / B;
    size_t j_lb = lb % B;
    size_t j_ub = ub % B;
    if (i_lb == i_ub) {
      resolve(i_lb);
      for (size_t j=j_lb; j<j_ub; ++j)
        bucket[i_lb][j] = val;
      summary[i_lb] = Fn::identity();
      for (size_t j=0; j<B; ++j)
        summary[i_lb] = fn(summary[i_lb], bucket[i_lb][j]);
      return;
    }

    {
      resolve(i_lb);
      for (size_t j=j_lb; j<B; ++j)
        bucket[i_lb][j] = val;
      summary[i_lb] = Fn::identity();
      for (size_t j=0; j<B; ++j)
        summary[i_lb] = fn(summary[i_lb], bucket[i_lb][j]);
    }
    for (size_t i=i_lb+1; i<i_ub; ++i) {
      summary[i] = val;
      buffered[i] = true;
    }
    {
      resolve(i_ub);
      for (size_t j=0; j<j_ub; ++j)
        bucket[i_ub][j] = val;
      summary[i_ub] = Fn::identity();
      for (size_t j=0; j<B; ++j)
        summary[i_ub] = fn(summary[i_ub], bucket[i_ub][j]);
    }
  }

  Tp query(size_t lb, size_t ub) {
    size_t i_lb = lb / B;
    size_t i_ub = ub / B;
    size_t j_lb = lb % B;
    size_t j_ub = ub % B;
    if (i_lb == i_ub) {
      resolve(i_lb);
      Tp res = Fn::identity();
      for (size_t j=j_lb; j<j_ub; ++j)
        res = fn(res, bucket[i_lb][j]);
      return res;
    }

    Tp res = Fn::identity();
    {
      resolve(i_lb);
      for (size_t j=j_lb; j<B; ++j)
        res = fn(res, bucket[i_lb][j]);
    }
    for (size_t i=i_lb+1; i<i_ub; ++i)
      res = fn(res, summary[i]);
    {
      resolve(i_ub);
      for (size_t j=0; j<j_ub; ++j)
        res = fn(res, bucket[i_ub][j]);
    }
    return res;
  }

  Tp operator [](size_t i) {
    // return query(i, i+1);
    if (buffered[i/B]) return summary[i/B];
    return bucket[i/B][i%B];
  }
};

template <class Tp>
struct min {
  static Tp identity() { return std::numeric_limits<Tp>::max(); }
  Tp operator ()(const Tp& x, const Tp& y) const { return std::min(x, y); }
};

template <class Tp>
struct max {
  static Tp identity() { return std::numeric_limits<Tp>::min(); }
  Tp operator ()(const Tp& x, const Tp& y) const { return std::max(x, y); }
};

int main() {
  size_t n, m;
  scanf("%zu %zu", &n, &m);

  std::vector<std::pair<int, int>> xy(m);
  for (size_t i=0; i<m; ++i)
    scanf("%d %d", &xy[i].first, &xy[i].second);

  std::sort(xy.begin(), xy.end(), std::greater<>());

  range_query<int, min<int>> left(n, 1e9);
  range_query<int, max<int>> right(n);
  for (size_t i=0; i<n; ++i) {
    left.update(i, i, i+1);
    right.update(i, i, i+1);
  }

  for (size_t i=0; i<m; ++i) {
    int y = xy[i].second;
    int lb0, ub0;
    {
      int lb = -1;
      int ub = n;
      while (ub-lb > 1) {
        int mid = (lb+ub)>>1;
        ((left[mid] < y)? lb:ub) = mid;
      }
      lb0 = ub;

      lb = -1;
      ub = n;
      while (ub-lb > 1) {
        int mid = (lb+ub)>>1;
        ((left[mid] <= y)? lb:ub) = mid;
      }
      ub0 = ub;
    }
    left.update(y-1, lb0, ub0);

    int lb1, ub1;
    {
      int lb = -1;
      int ub = n;
      while (ub-lb > 1) {
        int mid = (lb+ub)>>1;
        ((right[mid] < y-1)? lb:ub) = mid;
      }
      lb1 = ub;

      lb = -1;
      ub = n;
      while (ub-lb > 1) {
        int mid = (lb+ub)>>1;
        ((right[mid] <= y-1)? lb:ub) = mid;
      }
      ub1 = ub;
    }
    right.update(y, lb1, ub1);
  }

 for (size_t i=0; i<n; ++i)
    printf("%d%c", right[i]-left[i]+1, i+1<n? ' ':'\n');
}



Measured memory_bytes: 4808