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;
long long fme(long long a, long long b, long long mod) {
  if (b == 0) return 1;
  if (b & 1) return fme(a, b - 1, mod) * a % mod;
  long long tmp = fme(a, b / 2, mod);
  return tmp * tmp % mod;
}
int update(queue<int>& qa, map<int, int>& ma, map<int, int>& mb, long long p) {
  int cur = qa.front();
  qa.pop();
  pair<int, int> cands[] = {
      {(cur + 1) % p, 0}, {(cur - 1 + p) % p, 1}, {fme(cur, p - 2, p), 2}};
  for (auto& x : cands) {
    if (ma.count(x.first)) continue;
    ma[x.first] = x.second;
    auto it = mb.lower_bound(x.first);
    if (it != mb.end()) {
      long long k = it->first;
      if (k - x.first <= 1) {
        for (int i = 1; i <= k - x.first; i++) {
          if (ma.count(x.first - i) == 0) ma[x.first + i] = 0;
        }
        return k;
      }
    }
    if (it != mb.begin()) {
      it--;
      long long k = it->first;
      if (x.first - k >= 0 && x.first - k <= 1) {
        for (int i = 1; i <= x.first - k; i++) {
          if (ma.count(x.first - i) == 0) ma[x.first - i] = 1;
        }
        return k;
      }
    }
    qa.push(x.first);
  }
  return -1;
}
vector<int> restore(int cur, map<int, int>& ma, long long p, bool s = false) {
  vector<int> res;
  while (ma[cur] != -1) {
    if (ma[cur] == 2)
      res.push_back(2);
    else if (s)
      res.push_back(ma[cur] ^ 1);
    else
      res.push_back(ma[cur]);
    if (ma[cur] == 0)
      cur = (cur - 1 + p) % p;
    else if (ma[cur] == 1) {
      cur = (cur + 1) % p;
    } else
      cur = fme(cur, p - 2, p);
  }
  reverse(res.begin(), res.end());
  return res;
}
void check(vector<int> va, vector<int> vb, int a, int b, long long p) {
  for (auto x : vb) va.push_back(x);
  for (auto x : va) {
    if (x == 0) {
      a = (a + 1) % p;
    } else if (x == 1) {
      a = (a + p - 1) % p;
    } else
      a = fme(a, p - 2, p);
  }
  assert(a == b);
}
int32_t main() {
  ios::sync_with_stdio(false);
  int a, b, p;
  cin >> a >> b >> p;
  queue<int> qa, qb;
  map<int, int> ma, mb;
  qa.push(a);
  ma[a] = -1;
  qb.push(b);
  mb[b] = -1;
  for (;;) {
    int sa = update(qa, ma, mb, p);
    if (sa == -1) sa = update(qb, mb, ma, p);
    if (sa != -1) {
      auto va = restore(sa, ma, p);
      auto vb = restore(sa, mb, p, true);
      reverse(vb.begin(), vb.end());
      cout << va.size() + vb.size() << "\n";
      for (auto i : va) cout << i + 1 << " ";
      for (auto i : vb) cout << i + 1 << " ";
      cout << endl;
      break;
    }
  }
}