Problem: Recently Ivan bought a new computer. Excited, he unpacked it and installed his favourite game. With his old computer Ivan had to choose the worst possible graphic settings (because otherwise the framerate would be really low), but now he wants to check, maybe his new computer can perform well even with the best possible graphics?

There are m graphics parameters in the game. i-th parameter can be set to any positive integer from 1 to ai, and initially is set to bi (bi ≤ ai). So there are <image> different combinations of parameters. Ivan can increase or decrease any of these parameters by 1; after that the game will be restarted with new parameters (and Ivan will have the opportunity to check chosen combination of parameters).

Ivan wants to try all p possible combinations. Also he wants to return to the initial settings after trying all combinations, because he thinks that initial settings can be somehow best suited for his hardware. But Ivan doesn't really want to make a lot of restarts.

So he wants you to tell the following:

  * If there exists a way to make exactly p changes (each change either decreases or increases some parameter by 1) to try all possible combinations and return to initial combination, then Ivan wants to know this way. 
  * Otherwise, if there exists a way to make exactly p - 1 changes to try all possible combinations (including the initial one), then Ivan wants to know this way. 



Help Ivan by showing him the way to change parameters!

Input

The first line of input contains one integer number m (1 ≤ m ≤ 6).

The second line contains m integer numbers a1, a2, ..., am (2 ≤ ai ≤ 1000). It is guaranteed that <image>.

The third line contains m integer numbers b1, b2, ..., bm (1 ≤ bi ≤ ai).

Output

If there is a way to make exactly p changes (each change either decreases or increases some parameter by 1) to try all possible combinations and return to initial combination, then output Cycle in the first line. Then p lines must follow, each desribing a change. The line must be either inc x (increase parameter x by 1) or dec x (decrease it).

Otherwise, if there is a way to make exactly p - 1 changes to try all possible combinations (including the initial one), then output Path in the first line. Then p - 1 lines must follow, each describing the change the same way as mentioned above.

Otherwise, output No.

Examples

Input

1
3
1


Output

Path
inc 1
inc 1


Input

1
3
2


Output

No


Input

2
3 2
1 1


Output

Cycle
inc 1
inc 1
inc 2
dec 1
dec 1
dec 2

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
vector<vector<int> > makecycle(int h, int w) {
  vector<vector<int> > ret;
  for (int x = (0); x < (h); ++x) {
    vector<int> p(2);
    p[0] = x;
    if (x % 2 == 0)
      for (p[1] = 1; p[1] < w; ++p[1]) ret.push_back(p);
    if (x % 2 == 1)
      for (p[1] = w - 1; p[1] >= 1; --p[1]) ret.push_back(p);
  }
  {
    vector<int> p(2);
    p[1] = 0;
    for (p[0] = h - 1; p[0] >= 0; --p[0]) ret.push_back(p);
  }
  return ret;
}
void print(char *s, vector<vector<int> > p) {
  printf("%s:", s);
  for (int i = (0); i < (((int)(p).size())); ++i) {
    if (i != 0) printf(" ");
    for (int j = (0); j < (((int)(p[i]).size())); ++j) {
      if (j == 0)
        printf("(");
      else
        printf(",");
      printf("%d", p[i][j]);
    }
    printf(")");
  }
  puts("");
}
int tmp = 0;
vector<vector<int> > solve(vector<int> dim, vector<int> s) {
  vector<vector<int> > ret;
  if (((int)(dim).size()) == 1) {
    if (s[0] == 0) {
      vector<int> p = s;
      for (p[0] = 0; p[0] < dim[0]; ++p[0]) ret.push_back(p);
      if (dim[0] == 2) ret.push_back(s);
    } else if (s[0] == dim[0] - 1) {
      vector<int> p = s;
      for (p[0] = dim[0] - 1; p[0] >= 0; --p[0]) ret.push_back(p);
      if (dim[0] == 2) ret.push_back(s);
    }
  } else {
    int evenidx = -1;
    for (int i = (0); i < (((int)(dim).size())); ++i)
      if (dim[i] % 2 == 0) {
        evenidx = i;
        break;
      }
    if (evenidx != -1) {
      int othidx = -1;
      for (int i = (0); i < (((int)(dim).size())); ++i)
        if (i != evenidx) {
          othidx = i;
          break;
        }
      assert(othidx != -1);
      vector<vector<int> > cycle = makecycle(dim[evenidx], dim[othidx]);
      for (int i = (0); i < (((int)(cycle).size())); ++i) {
        vector<int> p(((int)(dim).size()), -1);
        p[evenidx] = cycle[i][0], p[othidx] = cycle[i][1];
        cycle[i] = p;
      }
      for (int i = (0); i < (((int)(dim).size())); ++i)
        if (i != evenidx && i != othidx) {
          vector<vector<int> > ncycle;
          for (int j = (0); j < (((int)(cycle).size())); ++j) {
            vector<int> p = cycle[j];
            if (j % 2 == 0)
              for (p[i] = 0; p[i] < dim[i]; ++p[i]) ncycle.push_back(p);
            if (j % 2 == 1)
              for (p[i] = dim[i] - 1; p[i] >= 0; --p[i]) ncycle.push_back(p);
          }
          cycle = ncycle;
        }
      int sidx = -1;
      for (int i = (0); i < (((int)(cycle).size())); ++i)
        if (cycle[i] == s) {
          sidx = i;
          break;
        }
      assert(sidx != -1);
      for (int i = (sidx); i < (((int)(cycle).size())); ++i)
        ret.push_back(cycle[i]);
      for (int i = (0); i <= (sidx); ++i) ret.push_back(cycle[i]);
    } else {
      int par = 0;
      for (int i = (0); i < (((int)(dim).size())); ++i) par = (par + s[i]) % 2;
      if (par == 0) {
        int erridx = -1;
        for (int i = (0); i < (((int)(dim).size())); ++i)
          if (dim[i] == 1) {
            erridx = i;
            break;
          }
        if (erridx == -1)
          for (int i = (0); i < (((int)(dim).size())); ++i)
            if (dim[i] != 3 || s[i] == 0 ||
                s[i] == 2 && ((int)(dim).size()) != 2) {
              erridx = i;
              break;
            }
        if (erridx == -1) {
          vector<vector<vector<int> > > pp(
              3, vector<vector<int> >(3, vector<int>(2)));
          for (int i = (0); i < (3); ++i)
            for (int j = (0); j < (3); ++j) pp[i][j][0] = i, pp[i][j][1] = j;
          vector<vector<int> > a(9);
          a[0] = pp[0][0], a[1] = pp[0][1], a[2] = pp[0][2], a[3] = pp[1][2],
          a[4] = pp[1][1], a[5] = pp[1][0], a[6] = pp[2][0], a[7] = pp[2][1],
          a[8] = pp[2][2];
          reverse(a.begin(), a.end());
          vector<vector<int> > b(9);
          b[0] = pp[0][0], b[1] = pp[0][1], b[2] = pp[0][2], b[3] = pp[1][2],
          b[4] = pp[2][2], b[5] = pp[2][1], b[6] = pp[2][0], b[7] = pp[1][0],
          b[8] = pp[1][1];
          reverse(b.begin(), b.end());
          if (((int)(dim).size()) == 2 && s[0] == 2 && s[1] == 2) {
            ret = a;
          } else {
            assert(((int)(dim).size()) % 2 == 0);
            for (int i = (0); i < (((int)(dim).size())); ++i)
              assert(dim[i] == 3 && s[i] == 1);
            vector<vector<int> > diag = a;
            ret = b;
            for (int rep = (0); rep < (((int)(dim).size()) / 2 - 1); ++rep) {
              vector<vector<int> > ndiag, nret;
              for (int i = (0); i < (((int)(a).size())); ++i) {
                vector<int> p(2 * rep + 4);
                p[0] = a[i][0], p[1] = a[i][1];
                if (i % 2 == 0)
                  for (int i = (0); i < (((int)(diag).size())); ++i) {
                    for (int j = (0); j < (((int)(diag[i]).size())); ++j)
                      p[2 + j] = diag[i][j];
                    ndiag.push_back(p);
                  }
                if (i % 2 == 1)
                  for (int i = ((int)(diag).size()) - 1; i >= 0; --i) {
                    for (int j = (0); j < (((int)(diag[i]).size())); ++j)
                      p[2 + j] = diag[i][j];
                    ndiag.push_back(p);
                  }
              }
              for (int i = (0); i < (((int)(b).size())); ++i) {
                vector<int> p(2 * rep + 4);
                p[0] = b[i][0], p[1] = b[i][1];
                vector<vector<int> > cur = i == 0 ? ret : diag;
                if (i % 2 == 0)
                  for (int i = (0); i < (((int)(cur).size())); ++i) {
                    for (int j = (0); j < (((int)(cur[i]).size())); ++j)
                      p[2 + j] = cur[i][j];
                    nret.push_back(p);
                  }
                if (i % 2 == 1)
                  for (int i = ((int)(cur).size()) - 1; i >= 0; --i) {
                    for (int j = (0); j < (((int)(cur[i]).size())); ++j)
                      p[2 + j] = cur[i][j];
                    nret.push_back(p);
                  }
              }
              diag = ndiag, ret = nret;
            }
          }
        } else {
          if (dim[erridx] == 1) {
            assert(s[erridx] == 0);
            if (((int)(dim).size()) == 1)
              ret.push_back(vector<int>(1, 0));
            else {
              vector<int> ndim;
              vector<int> ns;
              for (int i = (0); i < (((int)(dim).size())); ++i)
                if (i != erridx) ndim.push_back(dim[i]), ns.push_back(s[i]);
              ret = solve(ndim, ns);
              for (int i = (0); i < (((int)(ret).size())); ++i) {
                ret[i].insert(ret[i].begin() + erridx, 0);
              }
            }
          } else if (s[erridx] >= 2) {
            int joinidx = -1;
            for (int i = (0); i < (((int)(dim).size())); ++i)
              if (i != erridx) {
                joinidx = i;
                break;
              }
            vector<int> ndim1, ndim2;
            vector<int> ns1, ns2;
            int d = s[erridx] / 2 * 2;
            if (s[erridx] == dim[erridx] - 1 && ((int)(dim).size()) == 2)
              d -= 2;
            for (int i = (0); i < (((int)(dim).size())); ++i)
              ndim1.push_back(dim[i] - (i == erridx ? d : 0)),
                  ndim2.push_back(i == erridx ? d : dim[i]),
                  ns1.push_back(s[i] - (i == erridx ? d : 0)), ns2.push_back(0);
            vector<vector<int> > bottom = solve(ndim1, ns1),
                                 top = solve(ndim2, ns2);
            assert(((int)(top).size()) != 0 &&
                   top[0] == top[((int)(top).size()) - 1]);
            for (int i = (0); i < (((int)(top).size())); ++i)
              top[i][erridx] = d - top[i][erridx] - 1;
            for (int i = (0); i < (((int)(bottom).size())); ++i)
              bottom[i][erridx] += d;
            set<pair<vector<int>, vector<int> > > have;
            for (int i = (1); i < (((int)(bottom).size())); ++i)
              if (bottom[i - 1][erridx] == d && bottom[i][erridx] == d)
                have.insert(make_pair(bottom[i - 1], bottom[i]));
            vector<int> p1, p2;
            bool found = false;
            for (int rep = (0); rep < (2); ++rep) {
              for (int i = (1); i < (((int)(top).size())); ++i)
                if (top[i - 1][erridx] == d - 1 && top[i][erridx] == d - 1) {
                  p1 = top[i - 1], p2 = top[i], ++p1[erridx], ++p2[erridx];
                  if (have.count(make_pair(p1, p2))) {
                    found = true;
                    break;
                  }
                }
              if (found) break;
              reverse(top.begin(), top.end());
            }
            assert(found);
            int bidx = -1;
            for (int i = (1); i < (((int)(bottom).size())); ++i)
              if (p1 == bottom[i - 1] && p2 == bottom[i]) {
                bidx = i - 1;
                break;
              }
            assert(bidx != -1);
            --p1[erridx], --p2[erridx];
            int tidx = -1;
            for (int i = (1); i < (((int)(top).size())); ++i)
              if (p1 == top[i - 1] && p2 == top[i]) {
                tidx = i - 1;
                break;
              }
            assert(tidx != -1);
            top.pop_back();
            for (int i = (0); i <= (bidx); ++i) ret.push_back(bottom[i]);
            for (int i = tidx; i >= 0; --i) ret.push_back(top[i]);
            for (int i = ((int)(top).size()) - 1; i >= tidx + 1; --i)
              ret.push_back(top[i]);
            for (int i = (bidx + 1); i < (((int)(bottom).size())); ++i)
              ret.push_back(bottom[i]);
          } else if (s[erridx] < dim[erridx] - 2) {
            vector<int> ns;
            for (int j = (0); j < (((int)(dim).size())); ++j)
              ns.push_back(j == erridx ? dim[j] - s[j] - 1 : s[j]);
            ret = solve(dim, ns);
            for (int i = (0); i < (((int)(ret).size())); ++i)
              ret[i][erridx] = dim[erridx] - ret[i][erridx] - 1;
          }
        }
      }
    }
  }
  return ret;
}
bool verify(const vector<int> &dim, const vector<int> &s,
            const vector<vector<int> > &ans) {
  if (ans[0] != s) {
    printf("wrong start\n");
    return false;
  }
  int prod = 1;
  for (int i = (0); i < (((int)(dim).size())); ++i) prod *= dim[i];
  bool iscycle = ans[0] == ans[((int)(ans).size()) - 1];
  if (((int)(ans).size()) != prod + (iscycle ? 1 : 0)) {
    printf("wrong length\n");
    return false;
  }
  set<vector<int> > seen;
  seen.insert(ans[0]);
  for (int i = (1); i < (((int)(ans).size())); ++i) {
    if ((i != ((int)(ans).size()) - 1 || ans[i] != ans[0]) &&
        !seen.insert(ans[i]).second)
      return false;
    int ndiff = 0, diffidx = -1;
    for (int j = (0); j < (((int)(ans[i]).size())); ++j)
      if (ans[i - 1][j] != ans[i][j]) ++ndiff, diffidx = j;
    if (ndiff != 1) {
      printf("wrong ndiff\n");
      return false;
    }
    if (abs(ans[i - 1][diffidx] - ans[i][diffidx]) != 1) {
      printf("not 1 step\n");
      return false;
    }
  }
  return true;
}
void run() {
  int ndim;
  scanf("%d", &ndim);
  vector<int> dim(ndim);
  for (int i = (0); i < (ndim); ++i) scanf("%d", &dim[i]);
  vector<int> s(ndim);
  for (int i = (0); i < (ndim); ++i) scanf("%d", &s[i]), --s[i];
  vector<vector<int> > ans = solve(dim, s);
  if (((int)(ans).size()) == 0) {
    printf("No\n");
    return;
  }
  assert(verify(dim, s, ans));
  printf("%s\n", ans[0] == ans[((int)(ans).size()) - 1] ? "Cycle" : "Path");
  for (int i = (1); i < (((int)(ans).size())); ++i) {
    int idx = -1;
    for (int j = (0); j < (ndim); ++j)
      if (ans[i - 1][j] != ans[i][j]) {
        assert(idx == -1 && abs(ans[i - 1][j] - ans[i][j]) == 1);
        idx = j;
      }
    assert(idx != -1);
    printf("%s %d\n", ans[i][idx] == ans[i - 1][idx] + 1 ? "inc" : "dec",
           idx + 1);
  }
}
void stress() {
  for (int rep = (0); rep < (10000); ++rep) {
    int ndim = rand() % 6 + 1;
    vector<int> dim(ndim);
    vector<int> s(ndim);
    for (int i = (0); i < (ndim); ++i) {
      dim[i] = rand() % 3 * 2 + 3;
      s[i] = rand() % dim[i];
    }
    printf("%d  ", ndim);
    for (int i = (0); i < (((int)(dim).size())); ++i) printf("%d ", dim[i]);
    for (int i = (0); i < (((int)(s).size())); ++i) printf(" %d", s[i] + 1);
    puts("");
    vector<vector<int> > ans = solve(dim, s);
    if (((int)(ans).size()) != 0 && !verify(dim, s, ans))
      printf("Invalid path");
    printf(".");
  }
}
int main() {
  run();
  return 0;
}