#include <bits/stdc++.h>
std::set<int> S1, S2;
struct Queue {
  int Q[1000010], fr[1000010], *h, *t;
} Q1, Q2;
int p;
long long pw(long long a, int n, int p) {
  long long b = 1;
  for (; n; n >>= 1) n& 1 ? b = b * a % p : 1, a = a * a % p;
  return b;
}
int ex(Queue& q, std::set<int>& s, std::set<int>& ss) {
  int val = *q.h++;
  for (int i = 0; i < 3; i++) {
    int x = !i ? (val + 1) % p : i == 1 ? (val + p - 1) % p : pw(val, p - 2, p);
    if (s.find(x) == s.end()) {
      q.fr[q.t - q.Q] = q.h - q.Q - 1;
      s.insert(*q.t++ = x);
      if (ss.find(x) != ss.end()) return x;
    }
  }
  return -1;
}
int a1[210], a2[210], l1, l2;
void res(Queue& q, int x, int* a, int& l) {
  int i = 0;
  while (q.Q[i] != x) i++;
  a[l = 0] = x;
  while (i) i = q.fr[i], a[++l] = q.Q[i];
}
int rel(int x, int y) {
  return y == (x + 1) % p ? 1 : y == (x + p - 1) % p ? 2 : 3;
}
int main() {
  int u, v;
  scanf("%d%d%d", &u, &v, &p);
  if (u == v) return puts("0"), 0;
  Q1.h = Q1.Q, Q1.t = Q1.Q + 1, *Q1.Q = u;
  Q2.h = Q2.Q, Q2.t = Q2.Q + 1, *Q2.Q = v;
  S1.insert(u);
  S2.insert(v);
  for (;;) {
    int x;
    if (Q1.t - Q1.Q < Q2.t - Q2.Q)
      x = ex(Q1, S1, S2);
    else
      x = ex(Q2, S2, S1);
    if (x != -1) {
      res(Q1, x, a1, l1);
      res(Q2, x, a2, l2);
      printf("%d\n", l1 + l2);
      for (int i = l1; i--;) printf("%d ", rel(a1[i + 1], a1[i]));
      for (int i = 0; i < l2; i++) printf("%d ", rel(a2[i], a2[i + 1]));
      return 0;
    }
  }
}

### Prompt

Create a solution in Cpp for 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>
std::set<int> S1, S2;
struct Queue {
  int Q[1000010], fr[1000010], *h, *t;
} Q1, Q2;
int p;
long long pw(long long a, int n, int p) {
  long long b = 1;
  for (; n; n >>= 1) n& 1 ? b = b * a % p : 1, a = a * a % p;
  return b;
}
int ex(Queue& q, std::set<int>& s, std::set<int>& ss) {
  int val = *q.h++;
  for (int i = 0; i < 3; i++) {
    int x = !i ? (val + 1) % p : i == 1 ? (val + p - 1) % p : pw(val, p - 2, p);
    if (s.find(x) == s.end()) {
      q.fr[q.t - q.Q] = q.h - q.Q - 1;
      s.insert(*q.t++ = x);
      if (ss.find(x) != ss.end()) return x;
    }
  }
  return -1;
}
int a1[210], a2[210], l1, l2;
void res(Queue& q, int x, int* a, int& l) {
  int i = 0;
  while (q.Q[i] != x) i++;
  a[l = 0] = x;
  while (i) i = q.fr[i], a[++l] = q.Q[i];
}
int rel(int x, int y) {
  return y == (x + 1) % p ? 1 : y == (x + p - 1) % p ? 2 : 3;
}
int main() {
  int u, v;
  scanf("%d%d%d", &u, &v, &p);
  if (u == v) return puts("0"), 0;
  Q1.h = Q1.Q, Q1.t = Q1.Q + 1, *Q1.Q = u;
  Q2.h = Q2.Q, Q2.t = Q2.Q + 1, *Q2.Q = v;
  S1.insert(u);
  S2.insert(v);
  for (;;) {
    int x;
    if (Q1.t - Q1.Q < Q2.t - Q2.Q)
      x = ex(Q1, S1, S2);
    else
      x = ex(Q2, S2, S1);
    if (x != -1) {
      res(Q1, x, a1, l1);
      res(Q2, x, a2, l2);
      printf("%d\n", l1 + l2);
      for (int i = l1; i--;) printf("%d ", rel(a1[i + 1], a1[i]));
      for (int i = 0; i < l2; i++) printf("%d ", rel(a2[i], a2[i + 1]));
      return 0;
    }
  }
}

```