#include <bits/stdc++.h>
using namespace std;
int u, v, mod;
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int power(int a, int b) {
  int out = 1;
  while (b) {
    if (b & 1) out = mult(out, a);
    a = mult(a, a);
    b >>= 1;
  }
  return out;
}
unordered_map<int, pair<int, int> > mp;
mt19937 rnd(2309482);
vector<int> V[96000];
int main() {
  scanf("%d%d%d", &u, &v, &mod);
  if (u == v) {
    puts("0");
    return 0;
  }
  for (int i = 1; 1ll * i * i <= 3ll * mod; i++) {
    mp[u] = make_pair(i, -1);
    int np = u;
    for (int j = 0; j < 100; j++) {
      int cstp;
      if (j == 0)
        cstp = rnd() % 3 + 1;
      else {
        int v1, v2;
        if (V[i].back() == 1)
          v1 = 1, v2 = 3;
        else if (V[i].back() == 2)
          v1 = 2, v2 = 3;
        else
          v1 = 1, v2 = 2;
        if (rnd() & 1)
          cstp = v1;
        else
          cstp = v2;
      }
      if (cstp == 1)
        np = add(np, 1);
      else if (cstp == 2)
        np = add(np, mod - 1);
      else
        np = power(np, mod - 2);
      mp[np] = make_pair(i, j);
      V[i].push_back(cstp);
    }
  }
  if (mp.find(v) != mp.end()) {
    pair<int, int> tmp = mp[v];
    printf("%d\n", tmp.second + 1);
    for (int i = 0; i <= tmp.second; i++) printf("%d ", V[tmp.first][i]);
    return 0;
  }
  for (int i = 1; 1ll * i * i <= 3ll * mod; i++) {
    vector<int> cur;
    int np = v;
    for (int j = 0; j < 100; j++) {
      int cstp;
      if (j == 0)
        cstp = rnd() % 3 + 1;
      else {
        int v1, v2;
        if (V[i].back() == 1)
          v1 = 1, v2 = 3;
        else if (V[i].back() == 2)
          v1 = 2, v2 = 3;
        else
          v1 = 1, v2 = 2;
        if (rnd() & 1)
          cstp = v1;
        else
          cstp = v2;
      }
      cur.push_back(cstp);
      if (cstp == 1)
        np = add(np, mod - 1);
      else if (cstp == 2)
        np = add(np, 1);
      else
        np = power(np, mod - 2);
      if (mp.find(np) != mp.end()) {
        pair<int, int> tmp = mp[np];
        printf("%d\n", tmp.second + j + 2);
        for (int k = 0; k <= tmp.second; k++) printf("%d ", V[tmp.first][k]);
        for (int k = j; k >= 0; k--) printf("%d ", cur[k]);
        return 0;
      }
    }
  }
  puts("qaq");
  return 0;
}

### Prompt

Develop a solution in Cpp to the problem described below:

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. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
int u, v, mod;
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
inline int mult(int a, int b) {
  long long t = 1ll * a * b;
  if (t >= mod) t %= mod;
  return t;
}
inline int power(int a, int b) {
  int out = 1;
  while (b) {
    if (b & 1) out = mult(out, a);
    a = mult(a, a);
    b >>= 1;
  }
  return out;
}
unordered_map<int, pair<int, int> > mp;
mt19937 rnd(2309482);
vector<int> V[96000];
int main() {
  scanf("%d%d%d", &u, &v, &mod);
  if (u == v) {
    puts("0");
    return 0;
  }
  for (int i = 1; 1ll * i * i <= 3ll * mod; i++) {
    mp[u] = make_pair(i, -1);
    int np = u;
    for (int j = 0; j < 100; j++) {
      int cstp;
      if (j == 0)
        cstp = rnd() % 3 + 1;
      else {
        int v1, v2;
        if (V[i].back() == 1)
          v1 = 1, v2 = 3;
        else if (V[i].back() == 2)
          v1 = 2, v2 = 3;
        else
          v1 = 1, v2 = 2;
        if (rnd() & 1)
          cstp = v1;
        else
          cstp = v2;
      }
      if (cstp == 1)
        np = add(np, 1);
      else if (cstp == 2)
        np = add(np, mod - 1);
      else
        np = power(np, mod - 2);
      mp[np] = make_pair(i, j);
      V[i].push_back(cstp);
    }
  }
  if (mp.find(v) != mp.end()) {
    pair<int, int> tmp = mp[v];
    printf("%d\n", tmp.second + 1);
    for (int i = 0; i <= tmp.second; i++) printf("%d ", V[tmp.first][i]);
    return 0;
  }
  for (int i = 1; 1ll * i * i <= 3ll * mod; i++) {
    vector<int> cur;
    int np = v;
    for (int j = 0; j < 100; j++) {
      int cstp;
      if (j == 0)
        cstp = rnd() % 3 + 1;
      else {
        int v1, v2;
        if (V[i].back() == 1)
          v1 = 1, v2 = 3;
        else if (V[i].back() == 2)
          v1 = 2, v2 = 3;
        else
          v1 = 1, v2 = 2;
        if (rnd() & 1)
          cstp = v1;
        else
          cstp = v2;
      }
      cur.push_back(cstp);
      if (cstp == 1)
        np = add(np, mod - 1);
      else if (cstp == 2)
        np = add(np, 1);
      else
        np = power(np, mod - 2);
      if (mp.find(np) != mp.end()) {
        pair<int, int> tmp = mp[np];
        printf("%d\n", tmp.second + j + 2);
        for (int k = 0; k <= tmp.second; k++) printf("%d ", V[tmp.first][k]);
        for (int k = j; k >= 0; k--) printf("%d ", cur[k]);
        return 0;
      }
    }
  }
  puts("qaq");
  return 0;
}

```