#include <bits/stdc++.h>
using namespace std;
vector<int> ans[50005];
int cnt, u, v, p;
map<int, pair<int, int> > mp;
set<int> vis;
vector<int> na;
int s, t;
int power(int a, int b) {
  int temp = a, ans = 1;
  while (b) {
    if (b & 1) ans = (1LL * ans * temp) % p;
    temp = (1LL * temp * temp) % p;
    b >>= 1;
  }
  return ans;
}
int seed = 2340924, a = 23480293, b = 2348092;
int rand() { return seed = (1LL * (seed ^ a) * b) % 998244353; }
void Print(pair<int, int> x, vector<int> q) {
  printf("%d\n", x.second + q.size());
  for (int i = 0; i < x.second; i++) {
    printf("%d ", ans[x.first][i]);
  }
  for (int i = 0; i < q.size(); i++) {
    printf("%d ", q[i]);
  }
  return;
}
int op[4] = {0, 1, 2, 3};
int dfs(int c, int d) {
  if (vis.find(c) != vis.end()) return 0;
  vis.insert(c);
  map<int, pair<int, int> >::iterator it = mp.find(c);
  if (it != mp.end()) {
    s = it->second.first, t = it->second.second;
    return 1;
  }
  if (d == 100) return 0;
  int a = rand() % 3 + 1, b = rand() % 3 + 1;
  swap(op[a], op[b]);
  int gc = 0;
  for (int i = 1; i <= 3; i++) {
    if (op[i] == 1)
      gc = dfs((c + p - 1) % p, d + 1);
    else if (op[i] == 2)
      gc = dfs((c + 1) % p, d + 1);
    else
      gc = dfs(power(c, p - 2), d + 1);
    if (gc) {
      na.push_back(op[i]);
      swap(op[a], op[b]);
      return 1;
    }
  }
  swap(op[a], op[b]);
  return 0;
}
int main() {
  scanf("%d%d%d", &u, &v, &p);
  cnt = sqrt(p) + 1;
  for (int i = 1; i <= cnt; i++) {
    int g = u;
    for (int j = 1; j <= min(100, cnt); j++) {
      mp.insert(pair<int, pair<int, int> >{g, pair<int, int>{i, j - 1}});
      int op = rand() % 3 + 1;
      ans[i].push_back(op);
      if (op == 1)
        g = (g + 1) % p;
      else if (op == 2)
        g = (g + p - 1) % p;
      else
        g = power(g, p - 2);
    }
    mp.insert(pair<int, pair<int, int> >{g, pair<int, int>{i, min(100, cnt)}});
  }
  dfs(v, 0);
  Print(pair<int, int>{s, t}, na);
  return 0;
}

### Prompt

Please formulate a cpp solution to 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;
vector<int> ans[50005];
int cnt, u, v, p;
map<int, pair<int, int> > mp;
set<int> vis;
vector<int> na;
int s, t;
int power(int a, int b) {
  int temp = a, ans = 1;
  while (b) {
    if (b & 1) ans = (1LL * ans * temp) % p;
    temp = (1LL * temp * temp) % p;
    b >>= 1;
  }
  return ans;
}
int seed = 2340924, a = 23480293, b = 2348092;
int rand() { return seed = (1LL * (seed ^ a) * b) % 998244353; }
void Print(pair<int, int> x, vector<int> q) {
  printf("%d\n", x.second + q.size());
  for (int i = 0; i < x.second; i++) {
    printf("%d ", ans[x.first][i]);
  }
  for (int i = 0; i < q.size(); i++) {
    printf("%d ", q[i]);
  }
  return;
}
int op[4] = {0, 1, 2, 3};
int dfs(int c, int d) {
  if (vis.find(c) != vis.end()) return 0;
  vis.insert(c);
  map<int, pair<int, int> >::iterator it = mp.find(c);
  if (it != mp.end()) {
    s = it->second.first, t = it->second.second;
    return 1;
  }
  if (d == 100) return 0;
  int a = rand() % 3 + 1, b = rand() % 3 + 1;
  swap(op[a], op[b]);
  int gc = 0;
  for (int i = 1; i <= 3; i++) {
    if (op[i] == 1)
      gc = dfs((c + p - 1) % p, d + 1);
    else if (op[i] == 2)
      gc = dfs((c + 1) % p, d + 1);
    else
      gc = dfs(power(c, p - 2), d + 1);
    if (gc) {
      na.push_back(op[i]);
      swap(op[a], op[b]);
      return 1;
    }
  }
  swap(op[a], op[b]);
  return 0;
}
int main() {
  scanf("%d%d%d", &u, &v, &p);
  cnt = sqrt(p) + 1;
  for (int i = 1; i <= cnt; i++) {
    int g = u;
    for (int j = 1; j <= min(100, cnt); j++) {
      mp.insert(pair<int, pair<int, int> >{g, pair<int, int>{i, j - 1}});
      int op = rand() % 3 + 1;
      ans[i].push_back(op);
      if (op == 1)
        g = (g + 1) % p;
      else if (op == 2)
        g = (g + p - 1) % p;
      else
        g = power(g, p - 2);
    }
    mp.insert(pair<int, pair<int, int> >{g, pair<int, int>{i, min(100, cnt)}});
  }
  dfs(v, 0);
  Print(pair<int, int>{s, t}, na);
  return 0;
}

```