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;
long long int u, v, p;
map<long long int, bool> q;
map<long long int, bool> q1;
map<long long int, long long int> p1;
map<long long int, long long int> p2;
map<long long int, long long int> num;
map<long long int, long long int> num1;
map<long long int, long long int> ans;
map<long long int, long long int> ans1;
long long int qwq[1000001];
long long int qaq[1000001];
int mi(int x) {
  long long int ans = 1, base = x;
  long long int mod = p - 2;
  while (mod) {
    if (mod & 1) ans = (ans * base) % p;
    base = (base * base) % p;
    mod >>= 1;
  }
  return ans;
}
void print1(int x) {
  if (p1[x] == -1) return;
  print1(p1[x]);
  cout << num[x] << " ";
}
void print2(int x) {
  if (p2[x] == -1) return;
  cout << num1[x] << " ";
  print2(p2[x]);
}
void print(int x) {
  print1(x);
  print2(x);
}
void bfs() {
  long long int head = 0, end = 1, head1 = 0, end1 = 1;
  q[u] = 1;
  q1[v] = 1;
  p1[u] = -1;
  p2[v] = -1;
  qaq[1] = v;
  qwq[1] = u;
  long long int a, a1;
  while (1) {
    a = qwq[++head];
    long long int b = a + 1;
    if (b >= 0 && q[b] == 0) {
      b %= p;
      q[b] = 1;
      qwq[++end] = b;
      ans[b] = ans[a] + 1;
      p1[b] = a;
      num[b] = 1;
      if (q1[b] == 1) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
    b = a - 1;
    if (b >= 0 && q[b] == 0) {
      b %= p;
      q[b] = 1;
      qwq[++end] = b;
      ans[b] = ans[a] + 1;
      p1[b] = a;
      num[b] = 2;
      if (q1[b] == 1) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
    b = mi(a);
    if (b >= 0 && q[b] == 0) {
      b %= p;
      q[b] = 1;
      qwq[++end] = b;
      ans[b] = ans[a] + 1;
      p1[b] = a;
      num[b] = 3;
      if (q1[b]) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
    a1 = qaq[++head1];
    b = a1 + 1;
    if (b >= 0 && q1[b] == 0) {
      b %= p;
      q1[b] = 2;
      qaq[++end1] = b;
      ans1[b] = ans1[a1] + 1;
      p2[b] = a1;
      num1[b] = 2;
      if (q[b]) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
    b = a1 - 1;
    if (b >= 0 && q1[b] == 0) {
      b %= p;
      q1[b] = 1;
      qaq[++end1] = b;
      ans1[b] = ans1[a1] + 1;
      p2[b] = a1;
      num1[b] = 1;
      if (q[b]) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
    b = mi(a1);
    if (b >= 0 && q1[b] == 0) {
      b %= p;
      q1[b] = 1;
      qaq[++end1] = b;
      ans1[b] = ans1[a1] + 1;
      p2[b] = a1;
      num1[b] = 3;
      if (q[b] == 1) {
        cout << ans[b] + ans1[b] << endl;
        print(b);
        return;
      }
    }
  }
}
int main() {
  cin >> u >> v >> p;
  if (u == v) {
    cout << 0;
    return 0;
  }
  bfs();
  return 0;
}