#include <bits/stdc++.h>
using namespace std;
int mod;
long long fp(long long x, long long k) {
  if (k == 0) return 1;
  long long hf = fp(x, k / 2);
  return k % 2 ? hf * hf % mod * x % mod : hf * hf % mod;
}
int inv(int x) { return int(fp(x, mod - 2)); }
map<int, pair<int, int> > pv;
int s, t;
struct node {
  int v, tp;
};
int main() {
  cin >> s >> t >> mod;
  queue<node> que;
  que.push({s, 0});
  que.push({t, 1});
  int l, r;
  while (true) {
    auto nd = que.front();
    que.pop();
    int v = nd.v, tp = nd.tp;
    vector<int> ck = {(v + 1) % mod, (v - 1 + mod) % mod, inv(v)};
    bool found = false;
    for (int x : ck) {
      if (pv.count(x)) {
        if (pv[x].second == tp) continue;
        found = true;
        l = tp ? x : v;
        r = tp ? v : x;
      } else {
        pv[x] = {v, tp};
        que.push({x, tp});
      }
      if (found) break;
    }
    if (found) break;
  }
  vector<int> path;
  int cur = l;
  while (true) {
    path.push_back(cur);
    if (cur == s) break;
    cur = pv[cur].first;
  }
  reverse(path.begin(), path.end());
  cur = r;
  while (true) {
    path.push_back(cur);
    if (cur == t) break;
    cur = pv[cur].first;
  }
  vector<int> res;
  for (int i = 0; i + 1 < path.size(); i++) {
    int x = path[i], y = path[i + 1];
    if ((x + 1) % mod == y)
      res.push_back(1);
    else if ((x + mod - 1) % mod == y)
      res.push_back(2);
    else
      res.push_back(3);
  }
  cout << res.size() << endl;
  for (int x : res) cout << x << " ";
}

### 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 mod;
long long fp(long long x, long long k) {
  if (k == 0) return 1;
  long long hf = fp(x, k / 2);
  return k % 2 ? hf * hf % mod * x % mod : hf * hf % mod;
}
int inv(int x) { return int(fp(x, mod - 2)); }
map<int, pair<int, int> > pv;
int s, t;
struct node {
  int v, tp;
};
int main() {
  cin >> s >> t >> mod;
  queue<node> que;
  que.push({s, 0});
  que.push({t, 1});
  int l, r;
  while (true) {
    auto nd = que.front();
    que.pop();
    int v = nd.v, tp = nd.tp;
    vector<int> ck = {(v + 1) % mod, (v - 1 + mod) % mod, inv(v)};
    bool found = false;
    for (int x : ck) {
      if (pv.count(x)) {
        if (pv[x].second == tp) continue;
        found = true;
        l = tp ? x : v;
        r = tp ? v : x;
      } else {
        pv[x] = {v, tp};
        que.push({x, tp});
      }
      if (found) break;
    }
    if (found) break;
  }
  vector<int> path;
  int cur = l;
  while (true) {
    path.push_back(cur);
    if (cur == s) break;
    cur = pv[cur].first;
  }
  reverse(path.begin(), path.end());
  cur = r;
  while (true) {
    path.push_back(cur);
    if (cur == t) break;
    cur = pv[cur].first;
  }
  vector<int> res;
  for (int i = 0; i + 1 < path.size(); i++) {
    int x = path[i], y = path[i + 1];
    if ((x + 1) % mod == y)
      res.push_back(1);
    else if ((x + mod - 1) % mod == y)
      res.push_back(2);
    else
      res.push_back(3);
  }
  cout << res.size() << endl;
  for (int x : res) cout << x << " ";
}

```