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() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
__inline string next_line() {
  const int SIZE = 1100000;
  static char buf[SIZE + 1];
  static int p = SIZE;
  string res;
  int f = 1;
  while ((p < SIZE || (p = 0, buf[fread(buf, 1, SIZE, stdin)] = 0, buf[0])) &&
         (buf[p] != '\n' && (res += buf[p], f = 0, 1) || f))
    ++p;
  return res;
}
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);
const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;
int sgn(double x) {
  if (fabs(x) < eps) return 0;
  if (x < 0)
    return -1;
  else
    return 1;
}
struct Node {
  int vl, ty, bl;
} s;
int n, u, v, p;
queue<Node> Q;
map<int, int> hs;
map<int, pair<int, int> > pr;
int pw(int a, int n) {
  int ret = 1;
  while (n) {
    if (n & 1) ret = (long long)ret * a % p;
    a = (long long)a * a % p;
    n >>= 1;
  }
  return ret;
}
int gao(int x) {
  if (x == 3)
    return x;
  else
    return x == 1 ? 2 : 1;
}
void add(int w, int ty) {
  if (hs.count(w)) {
    if (hs[w] == s.bl) return;
    vector<int> a;
    int t;
    if (u != w) {
      if (s.bl == 1)
        a.push_back(ty), t = s.vl;
      else
        a.push_back(pr[w].second), t = pr[w].first;
      while (t != u) {
        a.push_back(pr[t].second), t = pr[t].first;
      }
      reverse(a.begin(), a.end());
    }
    if (v != w) {
      if (s.bl == 2)
        a.push_back(gao(ty)), t = s.vl;
      else
        a.push_back(gao(pr[w].second)), t = pr[w].first;
      while (t != v) {
        a.push_back(gao(pr[t].second)), t = pr[t].first;
      }
    }
    n = a.size();
    printf("%d\n", n);
    for (int i = 0; i < n; i++) printf("%d ", a[i]);
    printf("\n");
    exit(0);
  } else {
    Q.push(Node{w, ty, s.bl});
    hs[w] = s.bl;
    pr[w] = make_pair(s.vl, ty);
  }
}
int main() {
  scanf("%d%d%d", &u, &v, &p);
  Q.push(Node{u, 0, 1});
  hs[u] = 1;
  Q.push(Node{v, 0, 2});
  hs[v] = 2;
  while (1) {
    s = Q.front();
    Q.pop();
    add((s.vl + 1) % p, 1);
    add((s.vl + p - 1) % p, 2);
    add(pw(s.vl, p - 2), 3);
  }
}