A patient has been infected with an unknown disease. His body can be seen as an infinite grid of triangular cells which looks as follows:

<image>

Two cells are neighboring if they share a side. Therefore, each cell (x, y) has exactly three neighbors: 

  * (x+1, y) 
  * (x-1, y) 
  * (x+1, y-1) if x is even and (x-1, y+1) otherwise. 



Initially some cells are infected, all the others are healthy. The process of recovery begins. Each second, for exactly one cell (even though there might be multiple cells that could change its state) one of the following happens:

  * A healthy cell with at least 2 infected neighbors also becomes infected. 
  * An infected cell with at least 2 healthy neighbors also becomes healthy. 



If no such cell exists, the process of recovery stops. Patient is considered recovered if the process of recovery has stopped and all the cells are healthy.

We're interested in a worst-case scenario: is it possible that the patient never recovers, or if it's not possible, what is the maximum possible duration of the recovery process?

Input

The first line contains one integer n (1 ≤ n ≤ 250000) — the number of infected cells. 

The i-th of the next n lines contains two space-separated integers x_i and y_i (0 ≤ x_i, y_i < 500), meaning that cell (x_i, y_i) is infected. All cells (x_i, y_i) are distinct, and all other cells are considered healthy. 

Output

If it is possible that the organism never fully recovers from the disease, print SICK. Otherwise, you should print RECOVERED and in the next line an integer k — the longest possible recovery period, modulo 998244353. 

Examples

Input


4
0 0
1 0
2 0
0 1


Output


RECOVERED
4


Input


3
1 0
3 0
1 1


Output


SICK

Note

For the first testcase, the following drawings describe the longest possible recovery process. It can be proven that there are no recovery periods of length 5 or longer, and the organism always recovers in this testcase.

<image> \hspace{40pt} \downarrow <image> \hspace{40pt} \downarrow <image> \hspace{40pt} \downarrow <image> \hspace{40pt} \downarrow

\hspace{15pt} RECOVERED

For the second testcase, it is possible for the cells (2, 0), (2, 1), (0, 1) to become infected. After that, no cell can change its state, so the answer is SICK, as not all of the cells are healthy.
#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int n, x[N], y[N], i, j, tot, g[N], ccnt, F, trcnt;
int gfa(int x) { return g[x] == x ? x : g[x] = gfa(g[x]); }
bool b[505][505], cir, bb[505][505];
inline void tryuni(int x, int y) {
  x = gfa(x);
  y = gfa(y);
  if (x != y)
    g[x] = y, --ccnt;
  else
    cir = 1;
}
inline int idx(int x, int y) { return (x << 9) | y; }
void dfs(int x, int y);
inline int getv(int x, int y) { return 0 <= x && 0 <= y && b[x][y]; }
inline int getd(int x, int y) {
  return getv(x + 1, y) + getv(x - 1, y) +
         (x & 1 ? getv(x - 1, y + 1) : getv(x + 1, y - 1));
}
inline void ck(int x, int y) {
  if (0 <= x && 0 <= y && !b[x][y] && getd(x, y) > 1) dfs(x, y);
}
void dfs(int x, int y) {
  ++tot;
  b[x][y] = 1;
  ck(x + 1, y);
  ck(x - 1, y);
  x & 1 ? ck(x - 1, y + 1) : ck(x + 1, y - 1);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> x[i] >> y[i], b[x[i]][y[i]] = 1;
  memcpy(bb, b, sizeof b);
  for (i = 0; i <= 500; ++i) {
    ++i, --i;
    for (j = 0; j <= 500; ++j) {
      F += getv(i, j) ^ getv(i - 1, j);
      if (!(i & 1)) F += getv(i, j) ^ getv(i ^ 1, j - 1);
    }
  }
  for (i = 1; i <= n; ++i) dfs(x[i], y[i]);
  for (i = 0; i < N; ++i) g[i] = i;
  ccnt = tot;
  for (i = 0; i <= 500; ++i)
    for (j = 0; j <= 500; ++j)
      if (b[i][j]) {
        if (getv(i - 1, j)) tryuni(idx(i, j), idx(i - 1, j));
        if (!(i & 1) && getv(i ^ 1, j - 1))
          tryuni(idx(i, j), idx(i ^ 1, j - 1));
      }
  for (i = 0; i <= 500; ++i)
    for (j = 0; j <= 500; ++j)
      if (b[i][j] && getd(i, j) == 1 && b[i + 1][j] && !bb[i + 1][j]) {
        if (i & 1) {
          if (getv(i + 2, j) && getv(i + 2, j - 1) && getd(i + 2, j) == 1 &&
              getd(i + 2, j - 1) == 1)
            ++trcnt;
        } else {
          if (getv(i, j + 1) && getv(i + 2, j) && getd(i, j + 1) == 1 &&
              getd(i + 2, j) == 1)
            ++trcnt;
        }
      }
  if (cir)
    cout << "SICK\n";
  else
    cout << "RECOVERED\n" << (F - ccnt * 2 - trcnt * 2) << '\n';
}
