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;
using ll = long long;
using ld = long double;
using db = double;
using str = string;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<db, db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<db>;
using vs = vector<str>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
template <class T>
using V = vector<T>;
template <class T, size_t SZ>
using AR = array<T, SZ>;
template <class T>
using PR = pair<T, T>;
const int MOD = 998244353;
const int MX = 3e5 + 5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31 - __builtin_clz(x); }
ll cdiv(ll a, ll b) { return a / b + ((a ^ b) > 0 && a % b); }
ll fdiv(ll a, ll b) { return a / b - ((a ^ b) < 0 && a % b); }
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <class T, class U>
T fstTrue(T lo, T hi, U first) {
  hi++;
  assert(lo <= hi);
  while (lo < hi) {
    T mid = lo + (hi - lo) / 2;
    first(mid) ? hi = mid : lo = mid + 1;
  }
  return lo;
}
template <class T, class U>
T lstTrue(T lo, T hi, U first) {
  lo--;
  assert(lo <= hi);
  while (lo < hi) {
    T mid = lo + (hi - lo + 1) / 2;
    first(mid) ? lo = mid : hi = mid - 1;
  }
  return lo;
}
template <class T>
void remDup(vector<T>& v) {
  sort(begin(v), end(v));
  v.erase(unique(begin(v), end(v)), end(v));
}
template <class T, class U>
void erase(T& t, const U& u) {
  auto it = t.find(u);
  assert(it != end(t));
  t.erase(it);
}
template <class T>
void re(complex<T>& c);
template <class T, class U>
void re(pair<T, U>& p);
template <class T>
void re(vector<T>& v);
template <class T, size_t SZ>
void re(AR<T, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(db& d) {
  str t;
  re(t);
  d = stod(t);
}
void re(ld& d) {
  str t;
  re(t);
  d = stold(t);
}
template <class T, class... U>
void re(T& t, U&... u) {
  re(t);
  re(u...);
}
template <class T>
void re(complex<T>& c) {
  T a, b;
  re(a, b);
  c = {a, b};
}
template <class T, class U>
void re(pair<T, U>& p) {
  re(p.first, p.second);
}
template <class T>
void re(vector<T>& x) {
  for (auto& a : x) re(a);
}
template <class T, size_t SZ>
void re(AR<T, SZ>& x) {
  for (auto& a : x) re(a);
}
template <class T>
void rv(int& n, vector<T>& x) {
  re(n);
  x.resize(n);
  for (auto& a : x) re(a);
}
str to_string(char c) { return str(1, c); }
str to_string(const char* second) { return (str)second; }
str to_string(str second) { return second; }
str to_string(bool b) { return to_string((int)b); }
template <class T>
str to_string(complex<T> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
str to_string(vector<bool> v) {
  str res = "{";
  for (int i = (0); i < ((int)(v).size()); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
str to_string(bitset<SZ> b) {
  str res = "";
  for (int i = (0); i < (SZ); ++i) res += char('0' + b[i]);
  return res;
}
template <class T, class U>
str to_string(pair<T, U> p);
template <class T>
str to_string(T v) {
  bool fst = 1;
  str res = "";
  for (const auto& x : v) {
    if (!fst) res += " ";
    fst = 0;
    res += to_string(x);
  }
  return res;
}
template <class T, class U>
str to_string(pair<T, U> p) {
  return to_string(p.first) + " " + to_string(p.second);
}
template <class T>
void pr(T x) {
  cout << to_string(x);
}
template <class T, class... U>
void pr(const T& t, const U&... u) {
  pr(t);
  pr(u...);
}
void ps() { pr("\n"); }
template <class T, class... U>
void ps(const T& t, const U&... u) {
  pr(t);
  if (sizeof...(u)) pr(" ");
  ps(u...);
}
void DBG() { cerr << "]" << endl; }
template <class T, class... U>
void DBG(const T& t, const U&... u) {
  cerr << to_string(t);
  if (sizeof...(u)) cerr << ", ";
  DBG(u...);
}
void setIn(str second) { freopen(second.c_str(), "r", stdin); }
void setOut(str second) { freopen(second.c_str(), "w", stdout); }
void unsyncIO() { cin.tie(0)->sync_with_stdio(0); }
void setIO(str second = "") {
  unsyncIO();
  if ((int)(second).size()) {
    setIn(second + ".in"), setOut(second + ".out");
  }
}
int N, ans;
int deg[520][520];
bool infect[520][520], ori[520][520];
vi adj[300000];
bool present[MX], ORI[MX];
vpi nei(pi p) {
  vpi res;
  res.push_back({p.first - 1, p.second});
  res.push_back({p.first + 1, p.second});
  if (p.first % 2 == 0) {
    res.push_back({p.first + 1, p.second - 1});
  } else {
    res.push_back({p.first - 1, p.second + 1});
  }
  return res;
}
int hsh(pi p) { return 520 * p.first + p.second; }
bool vis[MX];
int sum_num, sum_ed;
vpi degs;
void dfs(int a, int b) {
  if (ORI[a]) {
    ans += 3;
    for (auto& t : adj[a])
      if (ORI[t]) ans--;
    0;
  }
  degs.push_back({ORI[a], (int)(adj[a]).size()});
  vis[a] = 1;
  for (auto& t : adj[a])
    if (t != b) {
      if (vis[t]) {
        ps("SICK");
        exit(0);
      }
      dfs(t, a);
    }
}
void solve(int x) {
  degs.clear();
  dfs(x, -1);
  ans -= 2;
  sort(begin(degs), end(degs));
  if (degs ==
      vpi{make_pair(0, 3), make_pair(1, 1), make_pair(1, 1), make_pair(1, 1)})
    ans -= 2;
}
int main() {
  setIO();
  re(N);
  queue<pi> todo;
  for (int i = (0); i < (N); ++i) {
    int x, y;
    re(x, y);
    x += 2, ++y;
    infect[x][y] = 1;
    ori[x][y] = 1;
    for (auto& t : nei({x, y})) {
      deg[t.first][t.second]++;
      if (deg[t.first][t.second] == 2) todo.push(t);
    }
  }
  while ((int)(todo).size()) {
    pi p = todo.front();
    todo.pop();
    if (infect[p.first][p.second]) continue;
    infect[p.first][p.second] = 1;
    for (auto& t : nei(p)) {
      deg[t.first][t.second]++;
      if (deg[t.first][t.second] == 2) todo.push(t);
    }
  }
  for (int i = (0); i < (520); ++i)
    for (int j = (0); j < (520); ++j)
      if (infect[i][j]) {
        present[hsh({i, j})] = 1;
        ORI[hsh({i, j})] = ori[i][j];
        for (auto& t : nei({i, j}))
          if (infect[t.first][t.second]) adj[hsh({i, j})].push_back(hsh(t));
      }
  for (int i = (0); i < (300000); ++i)
    if (present[i] && !vis[i]) solve(i);
  ps("RECOVERED");
  ps(ans);
}
