Sherlock met Moriarty for a final battle of wits. He gave him a regular n sided convex polygon. In addition to it, he gave him certain diagonals to form regions on the polygon. It was guaranteed that the diagonals did not intersect in interior points.

He took each of the region and calculated its importance value. Importance value for a region formed by vertices a1, a2, ... , ax of the polygon will be given by 2a1 + 2a2 + ... + 2ax. Then, he sorted these regions on the basis of their importance value in ascending order. After that he assigned each region an index from 1 to k, where k is the number of regions, and index of region is its position in the sorted array calculated above.

He wants Moriarty to color the regions using not more than 20 colors, such that two regions have same color only if all the simple paths between these two regions have at least one region with color value less than the color value assigned to these regions. Simple path between two regions f and h is a sequence of regions r1, r2, ... rt such that r1 = f, rt = h, for each 1 ≤ i < t regions ri and ri + 1 share an edge, and ri = rj if and only if i = j.

Moriarty couldn't answer and asks Sherlock to solve it himself. Help Sherlock in doing so.

Input

First line contains two integers n and m (3 ≤ n ≤ 100000, 0 ≤ m ≤ n - 3), the number of vertices in the polygon and the number of diagonals added.

Each of the next m lines contains two integers a and b (1 ≤ a, b ≤ n), describing a diagonal between vertices a and b. It is guaranteed that the diagonals are correct, i. e. a and b don't coincide and are not neighboring. It is guaranteed that the diagonals do not intersect.

Output

Let the number of regions be k.

Output k space-separated integers, each between 1 and 20, representing the colors of the regions in the order of increasing importance.

If there are multiple answers, print any of them. It can be shown that at least one answer exists.

Examples

Input

4 1
1 3


Output

1 2


Input

6 3
1 3
1 4
1 5


Output

2 1 2 3

Note

In 2nd input, regions formed in order after sorting will be (1, 2, 3), (1, 3, 4), (1, 4, 5), (1, 5, 6), i.e, region (1, 2, 3) is first region followed by region (1, 3, 4) and so on.

So, we can color regions 1 and 3 with same color, as region number 2 is on the path from 1 to 3 and it has color 1 which is less than color of 1 and 3, i.e., color number 2.
#include <bits/stdc++.h>
using namespace std;
char buf[1 << 20], *p1, *p2;
template <class T>
inline void read(T &n) {
  char ch =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
           ? 0
           : *p1++);
  T w = 1, x = 0;
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch =
        (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 20, stdin), p1 == p2)
             ? 0
             : *p1++);
  }
  n = x * w;
}
const int maxn = 100005;
int n, m, tot, nxt[maxn << 2];
int last[maxn], Next[maxn << 2], fr[maxn << 2], to[maxn << 2], cnt = 1;
inline void addedge(int x, int y) {
  Next[++cnt] = last[x], last[x] = cnt;
  fr[cnt] = x, to[cnt] = y;
}
pair<int, int> bot[maxn << 1];
int bel[maxn << 2], num;
vector<int> node[maxn];
void build(int x) {
  bel[x] = ++num;
  int st = fr[x];
  node[num].push_back(st);
  for (; to[x] != st; x = nxt[x]) {
    node[num].push_back(to[x]);
    bel[nxt[x]] = num;
  }
  sort(node[num].begin(), node[num].end(), greater<int>());
}
int id[maxn], rk[maxn];
bool cmp(int x, int y) {
  for (int i = 0; i < (int)node[x].size(); i++)
    if (node[x][i] != node[y][i]) return node[x][i] < node[y][i];
}
void Sort() {
  for (int i = 1; i <= num; i++) id[i] = i;
  sort(id + 1, id + num + 1, cmp);
  for (int i = 1; i <= num; i++) rk[id[i]] = i;
}
int size[maxn], maxp[maxn], col[maxn], rt, sz;
void getrt(int x, int fa) {
  size[x] = 1, maxp[x] = 0;
  for (int i = last[x]; i; i = Next[i]) {
    int v = to[i];
    if (!col[v] && v != fa) {
      getrt(v, x);
      size[x] += size[v];
      maxp[x] = max(maxp[x], size[v]);
    }
  }
  maxp[x] = max(maxp[x], sz - size[x]);
  if (maxp[x] < maxp[rt]) rt = x;
}
void solve(int x, int dep) {
  col[x] = dep;
  getrt(x, 0);
  for (int i = last[x]; i; i = Next[i]) {
    int v = to[i];
    if (!col[v]) {
      rt = 0, sz = size[v];
      getrt(v, x);
      solve(rt, dep + 1);
    }
  }
}
int main() {
  read(n), read(m);
  for (int i = 1; i <= n; i++) addedge(i, i % n + 1), addedge(i % n + 1, i);
  for (int i = 1, x, y; i <= m; i++) {
    read(x), read(y);
    addedge(x, y), addedge(y, x);
  }
  for (int x = 1; x <= n; x++) {
    tot = 0;
    for (int i = last[x]; i; i = Next[i]) bot[++tot] = make_pair(to[i], i);
    sort(bot + 1, bot + tot + 1);
    for (int i = 1; i <= tot; i++) {
      int j = bot[i % tot + 1].second;
      nxt[bot[i].second ^ 1] = j;
    }
  }
  for (int i = 2; i <= cnt; i++)
    if (!bel[i]) {
      if (to[i] == fr[i] % n + 1) continue;
      build(i);
    }
  Sort();
  int tmp = cnt;
  memset(last, 0, sizeof(last)), cnt = 0;
  for (int i = 2; i <= tmp; i += 2)
    if (bel[i] && bel[i ^ 1]) {
      addedge(rk[bel[i]], rk[bel[i ^ 1]]);
      addedge(rk[bel[i ^ 1]], rk[bel[i]]);
    }
  maxp[0] = n + 1, sz = num;
  getrt(1, 0);
  solve(rt, 1);
  for (int i = 1; i <= num; i++) printf("%d ", col[i]);
  return 0;
}
