#include <bits/stdc++.h>
using namespace std;
class TwoSat {
  static const int ME = 1000010;
  static const int MV = 2010;
  struct G {
    struct E {
      int u, v, next;
    } e[ME];
    int le, head[MV];
    void init() {
      le = 0;
      memset(head, -1, sizeof(head));
    }
    void add(int u, int v) {
      e[le].u = u;
      e[le].v = v;
      e[le].next = head[u];
      head[u] = le++;
    }
  } g;
  class Tarjan {
    int Index, Bcnt, num[MV], belong[MV], dfn[MV], low[MV];
    bool instack[MV];
    stack<int> s;
    void tarjan(int u) {
      dfn[u] = low[u] = ++Index;
      instack[u] = true;
      s.push(u);
      int v;
      for (int i = g.head[u]; ~i; i = g.e[i].next) {
        v = g.e[i].v;
        if (!dfn[v]) {
          tarjan(v);
          low[u] = min(low[u], low[v]);
        } else if (instack[v]) {
          low[u] = min(low[u], dfn[v]);
        }
      }
      if (dfn[u] == low[u]) {
        Bcnt++;
        do {
          v = s.top();
          s.pop();
          instack[v] = false;
          belong[v] = Bcnt;
          num[Bcnt]++;
        } while (u != v);
      }
    }

   public:
    G g;
    void init() {
      g.init();
      Index = Bcnt = 0;
      memset(num, 0, sizeof(num));
      memset(dfn, 0, sizeof(dfn));
      memset(low, 0, sizeof(low));
      memset(instack, 0, sizeof(instack));
      while (!s.empty()) s.pop();
    }
    void add(int u, int v) { g.add(u, v); }
    void solve(int n) {
      for (int i = 1; i <= n; i++) {
        if (!dfn[i]) {
          tarjan(i);
        }
      }
    }
    int getbcnt() { return Bcnt; }
    int getbelong(int id) { return belong[id]; }
    int getnum(int id) { return num[id]; }
  } T;
  class Unitenode {
    G ug;
    int n, in[MV];
    bool mat[MV][MV];
    queue<int> q;

   public:
    void init(int tn) {
      n = tn;
      ug.init();
      memset(in, 0, sizeof(in));
      for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) mat[i][j] = i == j ? true : false;
    }
    void add(int u, int v) {
      if (!mat[u][v]) {
        in[v]++;
        mat[u][v] = true;
        ug.add(u, v);
      }
    }
    void solve(int tp[]) {
      while (!q.empty()) q.pop();
      for (int i = 1; i <= n; i++) {
        if (!in[i]) {
          q.push(i);
        }
      }
      int ret = 1;
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        tp[ret++] = u;
        for (int i = ug.head[u]; ~i; i = ug.e[i].next) {
          int v = ug.e[i].v;
          in[v]--;
          if (!in[v]) {
            q.push(v);
          }
        }
      }
    }
  } U;
  void unite() {
    U.init(T.getbcnt());
    for (int i = 1; i <= n; i++) {
      for (int j = T.g.head[i]; ~j; j = T.g.e[j].next) {
        U.add(T.getbelong(i), T.getbelong(T.g.e[j].v));
      }
    }
  }
  int n, tp[MV];
  bool flag[MV];

 public:
  void init(int tn) {
    n = tn;
    T.init();
  }
  void add(int u, int v) { T.add(u, v); }
  bool solve() {
    T.solve(n);
    for (int i = 1, z = n / 2; i <= z; i++) {
      if (T.getbelong(i) == T.getbelong(i + z)) return false;
    }
    return true;
  }
  void output(bool ans[]) {
    unite();
    U.solve(tp);
    memset(flag, 0, sizeof(flag));
    for (int i = T.getbcnt(); i > 0; i--) {
      for (int j = 1, y; j <= n; j++) {
        if (j > n / 2)
          y = j - n / 2;
        else
          y = j;
        if (!flag[y] && T.getbelong(j) == tp[i]) {
          flag[y] = true;
          if (j > n / 2) {
            ans[j - n / 2] = true;
          } else {
            ans[j] = false;
          }
        }
      }
    }
  }
} gx;
const int M = 128;
struct IN {
  int x, y;
} in[M];
bool ok(int i, int j) {
  if (in[i].x < in[j].x && in[j].x < in[i].y && in[i].y < in[j].y) return true;
  return false;
}
bool judge(int i, int j) {
  if (ok(i, j) || ok(j, i)) return true;
  return false;
}
bool ans[M];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    gx.init(m * 2);
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &in[i].x, &in[i].y);
      if (in[i].x > in[i].y) swap(in[i].x, in[i].y);
    }
    for (int i = 1; i <= m; i++) {
      for (int j = i + 1; j <= m; j++) {
        if (judge(i, j)) {
          gx.add(i, j + m);
          gx.add(j, i + m);
          gx.add(i + m, j);
          gx.add(j + m, i);
        }
      }
    }
    if (gx.solve()) {
      gx.output(ans);
      for (int i = 1; i <= m; i++) {
        if (ans[i])
          printf("i");
        else
          printf("o");
      }
      puts("");
    } else {
      puts("Impossible");
    }
  }
  return 0;
}

### Prompt

Construct a CPP code solution to the problem outlined:

It is well known that Berland has n cities, which form the Silver ring — cities i and i + 1 (1 ≤ i < n) are connected by a road, as well as the cities n and 1. The goverment have decided to build m new roads. The list of the roads to build was prepared. Each road will connect two cities. Each road should be a curve which lies inside or outside the ring. New roads will have no common points with the ring (except the endpoints of the road).

Now the designers of the constructing plan wonder if it is possible to build the roads in such a way that no two roads intersect (note that the roads may intersect at their endpoints). If it is possible to do, which roads should be inside the ring, and which should be outside?

Input

The first line contains two integers n and m (4 ≤ n ≤ 100, 1 ≤ m ≤ 100). Each of the following m lines contains two integers ai and bi (1 ≤ ai, bi ≤ n, ai ≠ bi). No two cities will be connected by more than one road in the list. The list will not contain the roads which exist in the Silver ring.

Output

If it is impossible to build the roads in such a way that no two roads intersect, output Impossible. Otherwise print m characters. i-th character should be i, if the road should be inside the ring, and o if the road should be outside the ring. If there are several solutions, output any of them.

Examples

Input

4 2
1 3
2 4


Output

io


Input

6 3
1 3
3 5
5 1


Output

ooo

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
class TwoSat {
  static const int ME = 1000010;
  static const int MV = 2010;
  struct G {
    struct E {
      int u, v, next;
    } e[ME];
    int le, head[MV];
    void init() {
      le = 0;
      memset(head, -1, sizeof(head));
    }
    void add(int u, int v) {
      e[le].u = u;
      e[le].v = v;
      e[le].next = head[u];
      head[u] = le++;
    }
  } g;
  class Tarjan {
    int Index, Bcnt, num[MV], belong[MV], dfn[MV], low[MV];
    bool instack[MV];
    stack<int> s;
    void tarjan(int u) {
      dfn[u] = low[u] = ++Index;
      instack[u] = true;
      s.push(u);
      int v;
      for (int i = g.head[u]; ~i; i = g.e[i].next) {
        v = g.e[i].v;
        if (!dfn[v]) {
          tarjan(v);
          low[u] = min(low[u], low[v]);
        } else if (instack[v]) {
          low[u] = min(low[u], dfn[v]);
        }
      }
      if (dfn[u] == low[u]) {
        Bcnt++;
        do {
          v = s.top();
          s.pop();
          instack[v] = false;
          belong[v] = Bcnt;
          num[Bcnt]++;
        } while (u != v);
      }
    }

   public:
    G g;
    void init() {
      g.init();
      Index = Bcnt = 0;
      memset(num, 0, sizeof(num));
      memset(dfn, 0, sizeof(dfn));
      memset(low, 0, sizeof(low));
      memset(instack, 0, sizeof(instack));
      while (!s.empty()) s.pop();
    }
    void add(int u, int v) { g.add(u, v); }
    void solve(int n) {
      for (int i = 1; i <= n; i++) {
        if (!dfn[i]) {
          tarjan(i);
        }
      }
    }
    int getbcnt() { return Bcnt; }
    int getbelong(int id) { return belong[id]; }
    int getnum(int id) { return num[id]; }
  } T;
  class Unitenode {
    G ug;
    int n, in[MV];
    bool mat[MV][MV];
    queue<int> q;

   public:
    void init(int tn) {
      n = tn;
      ug.init();
      memset(in, 0, sizeof(in));
      for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++) mat[i][j] = i == j ? true : false;
    }
    void add(int u, int v) {
      if (!mat[u][v]) {
        in[v]++;
        mat[u][v] = true;
        ug.add(u, v);
      }
    }
    void solve(int tp[]) {
      while (!q.empty()) q.pop();
      for (int i = 1; i <= n; i++) {
        if (!in[i]) {
          q.push(i);
        }
      }
      int ret = 1;
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        tp[ret++] = u;
        for (int i = ug.head[u]; ~i; i = ug.e[i].next) {
          int v = ug.e[i].v;
          in[v]--;
          if (!in[v]) {
            q.push(v);
          }
        }
      }
    }
  } U;
  void unite() {
    U.init(T.getbcnt());
    for (int i = 1; i <= n; i++) {
      for (int j = T.g.head[i]; ~j; j = T.g.e[j].next) {
        U.add(T.getbelong(i), T.getbelong(T.g.e[j].v));
      }
    }
  }
  int n, tp[MV];
  bool flag[MV];

 public:
  void init(int tn) {
    n = tn;
    T.init();
  }
  void add(int u, int v) { T.add(u, v); }
  bool solve() {
    T.solve(n);
    for (int i = 1, z = n / 2; i <= z; i++) {
      if (T.getbelong(i) == T.getbelong(i + z)) return false;
    }
    return true;
  }
  void output(bool ans[]) {
    unite();
    U.solve(tp);
    memset(flag, 0, sizeof(flag));
    for (int i = T.getbcnt(); i > 0; i--) {
      for (int j = 1, y; j <= n; j++) {
        if (j > n / 2)
          y = j - n / 2;
        else
          y = j;
        if (!flag[y] && T.getbelong(j) == tp[i]) {
          flag[y] = true;
          if (j > n / 2) {
            ans[j - n / 2] = true;
          } else {
            ans[j] = false;
          }
        }
      }
    }
  }
} gx;
const int M = 128;
struct IN {
  int x, y;
} in[M];
bool ok(int i, int j) {
  if (in[i].x < in[j].x && in[j].x < in[i].y && in[i].y < in[j].y) return true;
  return false;
}
bool judge(int i, int j) {
  if (ok(i, j) || ok(j, i)) return true;
  return false;
}
bool ans[M];
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    gx.init(m * 2);
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &in[i].x, &in[i].y);
      if (in[i].x > in[i].y) swap(in[i].x, in[i].y);
    }
    for (int i = 1; i <= m; i++) {
      for (int j = i + 1; j <= m; j++) {
        if (judge(i, j)) {
          gx.add(i, j + m);
          gx.add(j, i + m);
          gx.add(i + m, j);
          gx.add(j + m, i);
        }
      }
    }
    if (gx.solve()) {
      gx.output(ans);
      for (int i = 1; i <= m; i++) {
        if (ans[i])
          printf("i");
        else
          printf("o");
      }
      puts("");
    } else {
      puts("Impossible");
    }
  }
  return 0;
}

```