#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
namespace Mymath {
long long qp(long long x, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % mod;
    x = x * x % mod;
    p >>= 1;
  }
  return ans;
}
long long inv(long long x, long long mod) { return qp(x, mod - 2, mod); }
long long C(long long N, long long K, long long fact[], long long mod) {
  return fact[N] * inv(fact[K], mod) % mod * inv(fact[N - K], mod) % mod;
}
template <typename Tp>
Tp gcd(Tp A, Tp B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
template <typename Tp>
Tp lcm(Tp A, Tp B) {
  return A * B / gcd(A, B);
}
};  // namespace Mymath
namespace fwt {
using namespace Mymath;
void FWT(int a[], int n, long long mod) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x + y) % mod, a[i + j + d] = (x - y + mod) % mod;
      }
}
void UFWT(int a[], int n, long long mod) {
  long long rev = inv(2, mod);
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = 1LL * (x + y) * rev % mod,
              a[i + j + d] = (1LL * (x - y) * rev % mod + mod) % mod;
      }
}
void solve(int a[], int b[], int n, long long mod) {
  FWT(a, n, mod);
  FWT(b, n, mod);
  for (int i = 0; i < n; i++) a[i] = 1LL * a[i] * b[i] % mod;
  UFWT(a, n, mod);
}
};  // namespace fwt
unordered_map<long long, long long> x, y;
long long u, v, p;
using namespace Mymath;
void Add(long long X, long long prv, vector<pair<long long, long long> > &tmp) {
  X = (X + p) % p;
  tmp.push_back(make_pair(X, prv));
}
int main() {
  cin >> u >> v >> p;
  vector<int> ans;
  if (u == v) {
    cout << 2 << endl << 1 << ' ' << 2 << endl;
    return 0;
  }
  if ((v - u + p) % p <= 200) {
    while (1) {
      u++;
      ans.push_back(1);
      u %= p;
      if (u == v) break;
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    return 0;
  }
  if ((u - v + p) % p <= 200) {
    while (1) {
      u--;
      u += p;
      ans.push_back(2);
      u %= p;
      if (u == v) break;
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    return 0;
  }
  int cur = u;
  x[u] = -1;
  for (int i = 0; i <= 30; i++) {
    vector<pair<long long, long long> > XX;
    for (auto X : x) {
      int Y = X.first;
      if (rand() % 3 < 2) Add(Y + 1, Y, XX);
      if (rand() % 3 < 2) Add(Y - 1, Y, XX);
      Add(inv(Y, p), Y, XX);
    }
    for (auto X : XX) {
      long long fi = X.first, se = X.second;
      if (!x.count(fi)) x[fi] = se;
    }
    if (x.size() >= 300000) break;
  }
  y[v] = -1;
  for (int t = 0; t <= 30; t++) {
    vector<pair<long long, long long> > XX;
    for (auto X : y) {
      int Y = X.first;
      if (x.count(Y)) {
        vector<long long> ans;
        long long Z = Y;
        while (Z != -1) {
          ans.push_back(Z);
          Z = x[Z];
        }
        reverse(ans.begin(), ans.end());
        Z = Y;
        while (Z != v) {
          Z = y[Z];
          ans.push_back(Z);
        }
        vector<int> res;
        for (int i = 1; i < ans.size(); i++) {
          long long now = ans[i], prv = ans[i - 1];
          if ((now - prv + p) % p == 1) {
            res.push_back(1);
          } else if ((prv - now + p) % p == 1) {
            res.push_back(2);
          } else {
            res.push_back(3);
          }
        }
        printf("%d\n", res.size());
        for (int i = 0; i < res.size(); i++) {
          printf("%d ", res[i]);
        }
        return 0;
      }
      if (rand() % 3 < 2) Add(Y + 1, Y, XX);
      if (rand() % 3 < 2) Add(Y - 1, Y, XX);
      Add(inv(Y, p), Y, XX);
    }
    for (auto X : XX) {
      long long fi = X.first, se = X.second;
      if (!y.count(fi)) y[fi] = se;
    }
  }
}

### Prompt

In cpp, your task is to solve 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;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
namespace Mymath {
long long qp(long long x, long long p, long long mod) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = ans * x % mod;
    x = x * x % mod;
    p >>= 1;
  }
  return ans;
}
long long inv(long long x, long long mod) { return qp(x, mod - 2, mod); }
long long C(long long N, long long K, long long fact[], long long mod) {
  return fact[N] * inv(fact[K], mod) % mod * inv(fact[N - K], mod) % mod;
}
template <typename Tp>
Tp gcd(Tp A, Tp B) {
  if (B == 0) return A;
  return gcd(B, A % B);
}
template <typename Tp>
Tp lcm(Tp A, Tp B) {
  return A * B / gcd(A, B);
}
};  // namespace Mymath
namespace fwt {
using namespace Mymath;
void FWT(int a[], int n, long long mod) {
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = (x + y) % mod, a[i + j + d] = (x - y + mod) % mod;
      }
}
void UFWT(int a[], int n, long long mod) {
  long long rev = inv(2, mod);
  for (int d = 1; d < n; d <<= 1)
    for (int m = d << 1, i = 0; i < n; i += m)
      for (int j = 0; j < d; j++) {
        int x = a[i + j], y = a[i + j + d];
        a[i + j] = 1LL * (x + y) * rev % mod,
              a[i + j + d] = (1LL * (x - y) * rev % mod + mod) % mod;
      }
}
void solve(int a[], int b[], int n, long long mod) {
  FWT(a, n, mod);
  FWT(b, n, mod);
  for (int i = 0; i < n; i++) a[i] = 1LL * a[i] * b[i] % mod;
  UFWT(a, n, mod);
}
};  // namespace fwt
unordered_map<long long, long long> x, y;
long long u, v, p;
using namespace Mymath;
void Add(long long X, long long prv, vector<pair<long long, long long> > &tmp) {
  X = (X + p) % p;
  tmp.push_back(make_pair(X, prv));
}
int main() {
  cin >> u >> v >> p;
  vector<int> ans;
  if (u == v) {
    cout << 2 << endl << 1 << ' ' << 2 << endl;
    return 0;
  }
  if ((v - u + p) % p <= 200) {
    while (1) {
      u++;
      ans.push_back(1);
      u %= p;
      if (u == v) break;
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    return 0;
  }
  if ((u - v + p) % p <= 200) {
    while (1) {
      u--;
      u += p;
      ans.push_back(2);
      u %= p;
      if (u == v) break;
    }
    printf("%d\n", ans.size());
    for (int i = 0; i < ans.size(); i++) {
      printf("%d ", ans[i]);
    }
    return 0;
  }
  int cur = u;
  x[u] = -1;
  for (int i = 0; i <= 30; i++) {
    vector<pair<long long, long long> > XX;
    for (auto X : x) {
      int Y = X.first;
      if (rand() % 3 < 2) Add(Y + 1, Y, XX);
      if (rand() % 3 < 2) Add(Y - 1, Y, XX);
      Add(inv(Y, p), Y, XX);
    }
    for (auto X : XX) {
      long long fi = X.first, se = X.second;
      if (!x.count(fi)) x[fi] = se;
    }
    if (x.size() >= 300000) break;
  }
  y[v] = -1;
  for (int t = 0; t <= 30; t++) {
    vector<pair<long long, long long> > XX;
    for (auto X : y) {
      int Y = X.first;
      if (x.count(Y)) {
        vector<long long> ans;
        long long Z = Y;
        while (Z != -1) {
          ans.push_back(Z);
          Z = x[Z];
        }
        reverse(ans.begin(), ans.end());
        Z = Y;
        while (Z != v) {
          Z = y[Z];
          ans.push_back(Z);
        }
        vector<int> res;
        for (int i = 1; i < ans.size(); i++) {
          long long now = ans[i], prv = ans[i - 1];
          if ((now - prv + p) % p == 1) {
            res.push_back(1);
          } else if ((prv - now + p) % p == 1) {
            res.push_back(2);
          } else {
            res.push_back(3);
          }
        }
        printf("%d\n", res.size());
        for (int i = 0; i < res.size(); i++) {
          printf("%d ", res[i]);
        }
        return 0;
      }
      if (rand() % 3 < 2) Add(Y + 1, Y, XX);
      if (rand() % 3 < 2) Add(Y - 1, Y, XX);
      Add(inv(Y, p), Y, XX);
    }
    for (auto X : XX) {
      long long fi = X.first, se = X.second;
      if (!y.count(fi)) y[fi] = se;
    }
  }
}

```