#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int u, v;
int p;
int power(ll x) {
  ll res = 1, t = p - 2;
  while (t) {
    if (t & 1) res = (res * x) % p;
    x = (x * x) % p;
    t >>= 1;
  }
  return res;
}
vector<int> restore(unordered_map<int, int>& mp, int t) {
  vector<int> res;
  while (t != -1 && mp[t] != -1) {
    int x = mp[t];
    int t1 = (t + 1) % p, t2 = (t + p - 1) % p;
    if (x == t1) {
      res.push_back(1);
    } else if (x == t2) {
      res.push_back(2);
    } else {
      res.push_back(3);
    }
    t = x;
  }
  return res;
}
void solve(unordered_map<int, int>& u1, unordered_map<int, int>& u2, int t) {
  auto com1 = restore(u1, t);
  reverse(com1.begin(), com1.end());
  for (auto& c : com1) {
    if (c <= 2) c = 3 - c;
  }
  auto com2 = restore(u2, t);
  for (auto& c : com2) {
    com1.push_back(c);
  }
  cout << com1.size() << endl;
  if (com1.empty()) {
    cout << endl;
  } else {
    for (int i = 0; i < (int)com1.size(); i++) {
      cout << com1[i] << " \n"[i + 1 == (int)com1.size()];
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> u >> v >> p;
  if (u == v) {
    cout << 0 << endl;
    cout << endl;
    return 0;
  }
  unordered_map<int, int> u1, u2;
  u1[u] = -1, u2[v] = -1;
  queue<int> q1({u}), q2({v});
  while (true) {
    int t = q1.front();
    q1.pop();
    int rt = power(t);
    if (0 < rt && u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    rt = (t + 1) % p;
    if (u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    rt = (t + p - 1) % p;
    if (u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    t = q2.front();
    q2.pop();
    rt = power(t);
    if (0 < rt && u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
    rt = (t + 1) % p;
    if (u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
    rt = (t + p - 1) % p;
    if (u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
  }
  return 0;
}

### Prompt

Please create a solution in Cpp 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;
using ll = long long;
int u, v;
int p;
int power(ll x) {
  ll res = 1, t = p - 2;
  while (t) {
    if (t & 1) res = (res * x) % p;
    x = (x * x) % p;
    t >>= 1;
  }
  return res;
}
vector<int> restore(unordered_map<int, int>& mp, int t) {
  vector<int> res;
  while (t != -1 && mp[t] != -1) {
    int x = mp[t];
    int t1 = (t + 1) % p, t2 = (t + p - 1) % p;
    if (x == t1) {
      res.push_back(1);
    } else if (x == t2) {
      res.push_back(2);
    } else {
      res.push_back(3);
    }
    t = x;
  }
  return res;
}
void solve(unordered_map<int, int>& u1, unordered_map<int, int>& u2, int t) {
  auto com1 = restore(u1, t);
  reverse(com1.begin(), com1.end());
  for (auto& c : com1) {
    if (c <= 2) c = 3 - c;
  }
  auto com2 = restore(u2, t);
  for (auto& c : com2) {
    com1.push_back(c);
  }
  cout << com1.size() << endl;
  if (com1.empty()) {
    cout << endl;
  } else {
    for (int i = 0; i < (int)com1.size(); i++) {
      cout << com1[i] << " \n"[i + 1 == (int)com1.size()];
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> u >> v >> p;
  if (u == v) {
    cout << 0 << endl;
    cout << endl;
    return 0;
  }
  unordered_map<int, int> u1, u2;
  u1[u] = -1, u2[v] = -1;
  queue<int> q1({u}), q2({v});
  while (true) {
    int t = q1.front();
    q1.pop();
    int rt = power(t);
    if (0 < rt && u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    rt = (t + 1) % p;
    if (u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    rt = (t + p - 1) % p;
    if (u1.count(rt) == 0) {
      u1[rt] = t;
      if (u2.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q1.push(rt);
    }
    t = q2.front();
    q2.pop();
    rt = power(t);
    if (0 < rt && u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
    rt = (t + 1) % p;
    if (u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
    rt = (t + p - 1) % p;
    if (u2.count(rt) == 0) {
      u2[rt] = t;
      if (u1.count(rt)) {
        solve(u1, u2, rt);
        return 0;
      }
      q2.push(rt);
    }
  }
  return 0;
}

```