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;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <class T>
ostream& operator<<(ostream& os, const V<T>& v) {
  cout << "[";
  for (auto p : v) cout << p << ", ";
  cout << "]";
  return os;
}
struct EG {
  ll g, x, y;
};
EG ext_gcd(ll a, ll b) {
  if (b == 0) {
    if (a >= 0)
      return EG{a, 1, 0};
    else
      return EG{-a, -1, 0};
  } else {
    auto e = ext_gcd(b, a % b);
    return EG{e.g, e.y, e.x - a / b * e.y};
  }
}
ll inv_mod(ll x, ll md) {
  if (x == 0) return 0;
  auto z = ext_gcd(x, md).x;
  return (z % md + md) % md;
}
using Q = pair<ll, ll>;
map<int, Q> mp;
int main() {
  srand(time(NULL));
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  ll u, v, p;
  cin >> u >> v >> p;
  for (int ph = 0; ph < 100000; ph++) {
    Q q;
    int nw = u;
    int bk = -1;
    for (int i = 0; i < 50; i++) {
      int ty;
      while (true) {
        ty = rand() % 3;
        if (bk == 1 && ty == 0) continue;
        if (bk == 0 && ty == 1) continue;
        if (bk == 2 && ty == 2) continue;
        break;
      }
      bk = ty;
      if (ty == 0) {
        nw++;
        if (nw == p) nw = 0;
        q.first |= (1LL << i);
      } else if (ty == 1) {
        nw--;
        if (nw == -1) nw = p - 1;
        q.second |= (1LL << i);
      } else {
        nw = inv_mod(nw, p);
      }
    }
    if (mp.count(nw)) continue;
    mp[nw] = q;
  }
  V<int> buf(50);
  while (true) {
    int nw = v;
    int bk = -1;
    for (int i = 0; i < 50; i++) {
      int ty;
      while (true) {
        ty = rand() % 3;
        if (bk == 1 && ty == 0) continue;
        if (bk == 0 && ty == 1) continue;
        if (bk == 2 && ty == 2) continue;
        break;
      }
      bk = ty;
      if (ty == 0) {
        nw++;
        if (nw == p) nw = 0;
        buf[i] = 1;
      } else if (ty == 1) {
        nw--;
        if (nw == -1) nw = p - 1;
        buf[i] = 0;
      } else {
        nw = inv_mod(nw, p);
        buf[i] = 2;
      }
    }
    static int g = 0;
    g++;
    auto it = mp.find(nw);
    if (it != mp.end()) {
      ll mid = it->first;
      if (mid - nw > 98) continue;
      Q q = it->second;
      V<int> ans;
      for (int i = 0; i < 50; i++) {
        if (q.first & (1LL << i))
          ans.push_back(0);
        else if (q.second & (1LL << i))
          ans.push_back(1);
        else
          ans.push_back(2);
      }
      for (int i = 0; i < mid - nw; i++) {
        ans.push_back(0);
      }
      for (int i = 49; i >= 0; i--) {
        ans.push_back(buf[i]);
      }
      int deb = u;
      for (auto ty : ans) {
        if (ty == 0) {
          deb++;
          if (deb == p) deb = 0;
        } else if (ty == 1) {
          deb--;
          if (deb == -1) deb = p - 1;
        } else {
          deb = inv_mod(deb, p);
        }
      }
      assert(deb == v);
      cout << ans.size() << endl;
      for (auto ty : ans) {
        cout << (ty + 1) << " ";
      }
      cout << endl;
      return 0;
    }
  }
  return 0;
}