Problem: Allen is playing Number Clicker on his phone.

He starts with an integer u on the screen. Every second, he can press one of 3 buttons.

  1. Turn u → u+1 \pmod{p}. 
  2. Turn u → u+p-1 \pmod{p}. 
  3. Turn u → u^{p-2} \pmod{p}. 



Allen wants to press at most 200 buttons and end up with v on the screen. Help him!

Input

The first line of the input contains 3 positive integers: u, v, p (0 ≤ u, v ≤ p-1, 3 ≤ p ≤ 10^9 + 9). p is guaranteed to be prime.

Output

On the first line, print a single integer ℓ, the number of button presses. On the second line, print integers c_1, ..., c_ℓ, the button presses. For 1 ≤ i ≤ ℓ, 1 ≤ c_i ≤ 3.

We can show that the answer always exists.

Examples

Input

1 3 5


Output

2
1 1


Input

3 2 5


Output

1
3

Note

In the first example the integer on the screen changes as 1 → 2 → 3.

In the second example the integer on the screen changes as 3 → 2. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int w = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    w = w * 10 + ch - '0';
    ch = getchar();
  }
  return w * f;
}
int u, v, mod, sum[210], nx1, nx2, w, cnt;
map<int, int> vis1, vis2, fa, kind;
int qsm(int x, int y) {
  int ans = 1, p = mod;
  while (y > 0) {
    if (y & 1) ans = (long long)ans % p * x % p % p;
    x = (long long)x % p * x % p;
    y >>= 1;
  }
  return ans % mod;
}
struct node {
  int hhh, sup;
};
inline void dbfs() {
  queue<node> p, q;
  p.push((node){u, 0});
  q.push((node){v, 0});
  vis1[u] = vis2[v] = 1;
  while (p.size() || q.size()) {
    if (p.size()) {
      int x = p.front().hhh, y = p.front().sup, xx;
      p.pop();
      if (y > 199) continue;
      xx = (x - 1 + mod) % mod;
      if (vis2[xx]) {
        nx1 = x;
        nx2 = xx;
        w = 2;
        break;
      }
      if (!vis1[xx])
        vis1[xx] = 1, fa[xx] = x, kind[xx] = 2, p.push((node){xx, y + 1});
      xx = (x + 1 + mod) % mod;
      if (vis2[xx]) {
        nx1 = x;
        nx2 = xx;
        w = 1;
        break;
      }
      if (!vis1[xx])
        vis1[xx] = 1, fa[xx] = x, kind[xx] = 1, p.push((node){xx, y + 1});
      xx = qsm(x, mod - 2);
      if (vis2[xx]) {
        nx1 = x;
        nx2 = xx;
        w = 3;
        break;
      }
      if (!vis1[xx])
        vis1[xx] = 1, fa[xx] = x, kind[xx] = 3, p.push((node){xx, y + 1});
    }
    if (q.size()) {
      int x = q.front().hhh, y = q.front().sup, xx;
      q.pop();
      if (y > 199) continue;
      xx = (x - 1 + mod) % mod;
      if (vis1[xx]) {
        nx1 = xx;
        nx2 = x;
        w = 1;
        break;
      }
      if (!vis2[xx])
        vis2[xx] = 1, fa[xx] = x, kind[xx] = 1, q.push((node){xx, y + 1});
      xx = (x + 1 + mod) % mod;
      if (vis1[xx]) {
        nx1 = xx;
        nx2 = x;
        w = 2;
        break;
      }
      if (!vis2[xx])
        vis2[xx] = 1, fa[xx] = x, kind[xx] = 2, q.push((node){xx, y + 1});
      xx = qsm(x, mod - 2);
      if (vis1[xx]) {
        nx1 = xx;
        nx2 = x;
        w = 3;
        break;
      }
      if (!vis2[xx])
        vis2[xx] = 1, fa[xx] = x, kind[xx] = 3, q.push((node){xx, y + 1});
    }
  }
}
inline void dfs1(int x) {
  if (x == u) return;
  dfs1(fa[x]);
  sum[++cnt] = kind[x];
}
inline void dfs2(int x) {
  if (x == v) return;
  sum[++cnt] = kind[x];
  dfs2(fa[x]);
}
int main() {
  u = read();
  v = read();
  mod = read();
  if (u == v) {
    printf("0");
    return 0;
  }
  dbfs();
  dfs1(nx1);
  sum[++cnt] = w;
  dfs2(nx2);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++) printf("%d ", sum[i]);
  return 0;
}