#include <bits/stdc++.h>
using namespace std;
long long x, w, o, z, n, a, b, c, u, v, p;
map<int, bool> was, was2;
map<int, int> d, d2;
map<int, int> p2, p1;
queue<int> q;
vector<int> ans;
long long bin_power(long long x, long long y, long long p) {
  if (y == 0) return 1;
  if (y == 1) return x;
  if (y % 2 == 1) return (bin_power(x, y - 1, p) * x) % p;
  long long z = bin_power(x, y / 2, p);
  return (z * z) % p;
}
int main() {
  cin >> u >> v >> p;
  q.push(u);
  p1[u] = -1;
  was[u] = true;
  long long zz = 1;
  while (!q.empty()) {
    if (zz > 400000) break;
    z = q.front();
    q.pop();
    if (was[(z + 1) % p] == false && d[z] <= 100) {
      d[(z + 1) % p] = d[z] + 1;
      p1[(z + 1) % p] = z;
      was[(z + 1) % p] = true;
      zz++;
      q.push((z + 1) % p);
    }
    if (was[(z + p - 1) % p] == false && d[z] <= 100) {
      d[(z + p - 1) % p] = d[z] + 1;
      p1[(z + p - 1) % p] = z;
      was[(z + p - 1) % p] = true;
      zz++;
      q.push((z + p - 1) % p);
    }
    w = bin_power(z, p - 2, p);
    if (was[w] == false && d[z] <= 100) {
      d[w] = d[z] + 1;
      p1[w] = z;
      was[w] = true;
      zz++;
      q.push(w);
    }
  }
  while (!q.empty()) q.pop();
  q.push(v);
  was2[v] = true;
  p2[v] = -1;
  while (!q.empty()) {
    z = q.front();
    q.pop();
    if (was[z] == true) {
      o = z;
      break;
    }
    if (was2[(z + 1) % p] == false && d2[z] <= 100) {
      d2[(z + 1) % p] = d[z] + 1;
      p2[(z + 1) % p] = z;
      was2[(z + 1) % p] = true;
      q.push((z + 1) % p);
    }
    if (was2[(z + p - 1) % p] == false && d2[z] <= 100) {
      d2[(z + p - 1) % p] = d[z] + 1;
      p2[(z + p - 1) % p] = z;
      was2[(z + p - 1) % p] = true;
      q.push((z + p - 1) % p);
    }
    w = bin_power(z, p - 2, p);
    if (was2[w] == false && d2[z] <= 100) {
      d2[w] = d[z] + 1;
      p2[w] = z;
      was2[w] = true;
      q.push(w);
    }
  }
  x = o;
  while (p1[x] != -1) {
    if ((p1[x] + 1) % p == x)
      ans.push_back(1);
    else if ((p1[x] - 1 + p) % p == x)
      ans.push_back(2);
    else
      ans.push_back(3);
    x = p1[x];
  }
  reverse(ans.begin(), ans.end());
  x = o;
  while (p2[x] != -1) {
    if ((p2[x] + 1) % p == x)
      ans.push_back(2);
    else if ((p2[x] - 1 + p) % p == x)
      ans.push_back(1);
    else
      ans.push_back(3);
    x = p2[x];
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  return 0;
}

### Prompt

Create a solution in cpp for the following 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. 

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long x, w, o, z, n, a, b, c, u, v, p;
map<int, bool> was, was2;
map<int, int> d, d2;
map<int, int> p2, p1;
queue<int> q;
vector<int> ans;
long long bin_power(long long x, long long y, long long p) {
  if (y == 0) return 1;
  if (y == 1) return x;
  if (y % 2 == 1) return (bin_power(x, y - 1, p) * x) % p;
  long long z = bin_power(x, y / 2, p);
  return (z * z) % p;
}
int main() {
  cin >> u >> v >> p;
  q.push(u);
  p1[u] = -1;
  was[u] = true;
  long long zz = 1;
  while (!q.empty()) {
    if (zz > 400000) break;
    z = q.front();
    q.pop();
    if (was[(z + 1) % p] == false && d[z] <= 100) {
      d[(z + 1) % p] = d[z] + 1;
      p1[(z + 1) % p] = z;
      was[(z + 1) % p] = true;
      zz++;
      q.push((z + 1) % p);
    }
    if (was[(z + p - 1) % p] == false && d[z] <= 100) {
      d[(z + p - 1) % p] = d[z] + 1;
      p1[(z + p - 1) % p] = z;
      was[(z + p - 1) % p] = true;
      zz++;
      q.push((z + p - 1) % p);
    }
    w = bin_power(z, p - 2, p);
    if (was[w] == false && d[z] <= 100) {
      d[w] = d[z] + 1;
      p1[w] = z;
      was[w] = true;
      zz++;
      q.push(w);
    }
  }
  while (!q.empty()) q.pop();
  q.push(v);
  was2[v] = true;
  p2[v] = -1;
  while (!q.empty()) {
    z = q.front();
    q.pop();
    if (was[z] == true) {
      o = z;
      break;
    }
    if (was2[(z + 1) % p] == false && d2[z] <= 100) {
      d2[(z + 1) % p] = d[z] + 1;
      p2[(z + 1) % p] = z;
      was2[(z + 1) % p] = true;
      q.push((z + 1) % p);
    }
    if (was2[(z + p - 1) % p] == false && d2[z] <= 100) {
      d2[(z + p - 1) % p] = d[z] + 1;
      p2[(z + p - 1) % p] = z;
      was2[(z + p - 1) % p] = true;
      q.push((z + p - 1) % p);
    }
    w = bin_power(z, p - 2, p);
    if (was2[w] == false && d2[z] <= 100) {
      d2[w] = d[z] + 1;
      p2[w] = z;
      was2[w] = true;
      q.push(w);
    }
  }
  x = o;
  while (p1[x] != -1) {
    if ((p1[x] + 1) % p == x)
      ans.push_back(1);
    else if ((p1[x] - 1 + p) % p == x)
      ans.push_back(2);
    else
      ans.push_back(3);
    x = p1[x];
  }
  reverse(ans.begin(), ans.end());
  x = o;
  while (p2[x] != -1) {
    if ((p2[x] + 1) % p == x)
      ans.push_back(2);
    else if ((p2[x] - 1 + p) % p == x)
      ans.push_back(1);
    else
      ans.push_back(3);
    x = p2[x];
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  return 0;
}

```