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. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
  for (int i = 0; i < (v.size()); ++i) os << v[i] << " ";
  os << endl;
  return os;
}
void verify(bool condition) {
  if (!condition) cerr << "WRONG WRONG" << endl;
}
int p;
int PP(int x, int n) {
  if (n == 0)
    return 1;
  else {
    long long z = PP(x, n / 2);
    if (n % 2 == 0)
      return (z * z) % p;
    else
      return (z * z) % p * x % p;
  }
}
void bfs(int v, vector<int> &res, map<int, int> &before) {
  int maxd = 18;
  int maxOffset = 1;
  vector<int> q;
  q.push_back(v);
  map<int, int> ma;
  ma[v] = 0;
  for (int i = 0; i < q.size(); ++i) {
    int curv = q[i];
    int d = ma[curv];
    if (d >= maxd) continue;
    int nextv = PP(curv, p - 2);
    if (ma.find(nextv) == ma.end()) {
      ma[nextv] = d + 1;
      before[nextv] = curv;
      q.push_back(nextv);
    }
    for (int x = (-maxOffset); x <= (maxOffset); ++x)
      if (x != 0) {
        int nextv = (curv + x + p) % p;
        if (ma.find(nextv) == ma.end()) {
          ma[nextv] = d + 1;
          before[nextv] = curv;
          q.push_back(nextv);
        }
      }
  }
  sort(q.begin(), q.end());
  for (int i = 0; i < (q.size()); ++i) res.push_back(q[i]);
}
vector<int> trace(int u, int v, map<int, int> &before) {
  vector<int> res;
  while (u != v) {
    int bu = before[u];
    if ((bu + 1) % p == u)
      res.push_back(1);
    else if ((bu + p - 1) % p == u)
      res.push_back(2);
    else
      res.push_back(3);
    u = bu;
  }
  reverse(res.begin(), res.end());
  return res;
}
void check(vector<int> &res, int u, int v) {
  for (int i = 0; i < (res.size()); ++i) {
    if (res[i] == 1)
      u = (u + 1) % p;
    else if (res[i] == 2)
      u = (u + p - 1) % p;
    else
      u = PP(u, p - 2);
  }
  if (u == v) cout << "Correct" << endl;
}
int main() {
  int u, v;
  cin >> u >> v >> p;
  map<int, int> bu, bv;
  vector<int> vu;
  bfs(u, vu, bu);
  vector<int> vv;
  bfs(v, vv, bv);
  for (int i = 0; i < (vv.size()); ++i) {
    int tv = vv[i];
    int id = lower_bound(vu.begin(), vu.end(), tv) - vu.begin();
    if (id < vu.size() && vu[id] >= tv && vu[id] - tv < 150) {
      int tu = vu[id];
      vector<int> p1 = trace(tu, u, bu);
      vector<int> p2 = trace(tv, v, bv);
      reverse(p2.begin(), p2.end());
      vector<int> res;
      for (int i = 0; i < (p1.size()); ++i) res.push_back(p1[i]);
      for (int i = 0; i < (vu[id] - tv); ++i) res.push_back(2);
      for (int i = 0; i < (p2.size()); ++i) {
        if (p2[i] == 3)
          res.push_back(p2[i]);
        else
          res.push_back(3 - p2[i]);
      }
      cout << res.size() << endl;
      for (int i = 0; i < (res.size()); ++i) cout << res[i] << " ";
      cout << endl;
      break;
    }
  }
  return 0;
}