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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.StringTokenizer;
import java.util.Random;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kessido
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ENumberClicker solver = new ENumberClicker();
        solver.solve(1, in, out);
        out.close();
    }

    static class ENumberClicker {
        int m;
        int[] res = new int[101];
        Random r = new Random();
        TreeMap<Integer, int[]> hm = new TreeMap<>();
        boolean addIfNeverSaw;
        boolean returnIfSawAlready;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int u = in.NextInt();
            int v = in.NextInt();
            m = in.NextInt();
            int res;
            addIfNeverSaw = true;
            returnIfSawAlready = false;
            for (int i = 0; i < 10000; i++) {
                randomSeq(v, 0);
            }
            addIfNeverSaw = false;
            returnIfSawAlready = true;
            int[] seq1 = null, seq2 = null;
            while (seq2 == null) {
                Pair<Integer, int[]> s = randomSeq(u, 0);
                if (s == null) continue;
                seq1 = s.second;
                seq2 = hm.get(s.first);
            }
            out.println(seq1.length + seq2.length);
            for (int i : seq1)
                out.print(i + " ");
            seq2 = ArraysExtention.getReversed(seq2);
            for (int i : seq2)
                out.print((i == 3 ? 3 : 3 - i) + " ");
            out.println();
        }

        Pair<Integer, int[]> randomSeq(int u, int i) {
            if (!hm.containsKey(u)) {
                if (addIfNeverSaw)
                    hm.put(u, Arrays.copyOf(res, i));
            } else {
                if (returnIfSawAlready)
                    return new Pair<>(u, Arrays.copyOf(res, i));
            }
            if (i == 100) {
                return null;
            } else {
                switch (r.nextInt(3) + 1) {
                    case 1:
                        res[i++] = 1;
                        u++;
                        if (u == m) u = 0;
                        return randomSeq(u, i);
                    case 2:
                        res[i++] = 2;
                        u--;
                        if (u == -1) u = m - 1;
                        return randomSeq(u, i);
                    case 3:
                        res[i++] = 3;
                        u = (int) MathExtentions.modInverse_For_M_Prime(u, m);
                        return randomSeq(u, i);
                }
                return null;
            }
        }

    }

    static class ArraysExtention {
        public static int[] getReversed(int[] a) {
            int[] aa = new int[a.length];
            for (int i = 0; i < a.length; i++) {
                aa[i] = a[a.length - 1 - i];
            }
            return aa;
        }

    }

    static class Pair<T1, T2> {
        public T1 first;
        public T2 second;

        public Pair(T1 f, T2 s) {
            first = f;
            second = s;
        }

    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int NextInt() {
            return Integer.parseInt(next());
        }

    }

    static class MathExtentions {
        public static long modInverse_For_M_Prime(final long a, final long m) {
            return powerMod(a, m - 2, m);
        }

        public static long powerMod(final long x, final long y, final long m) {
            if (y == 0)
                return 1;

            long p = powerMod(x, y / 2, m) % m;
            p = (p * p) % m;

            if (y % 2 == 0)
                return p;
            else
                return (x * p) % m;
        }

    }
}