Problem: You have a blackboard and initially only an odd number x is written on it. Your goal is to write the number 1 on the blackboard.

You may write new numbers on the blackboard with the following two operations. 

  * You may take two numbers (not necessarily distinct) already on the blackboard and write their sum on the blackboard. The two numbers you have chosen remain on the blackboard. 
  * You may take two numbers (not necessarily distinct) already on the blackboard and write their [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) on the blackboard. The two numbers you have chosen remain on the blackboard. 

Perform a sequence of operations such that at the end the number 1 is on the blackboard.

Input

The single line of the input contains the odd integer x (3 ≤ x ≤ 999,999).

Output

Print on the first line the number q of operations you perform. Then q lines should follow, each describing one operation. 

  * The "sum" operation is described by the line "a + b", where a, b must be integers already present on the blackboard. 
  * The "xor" operation is described by the line "a ^ b", where a, b must be integers already present on the blackboard. 

The operation symbol (+ or ^) must be separated from a, b by a whitespace.

You can perform at most 100,000 operations (that is, q≤ 100,000) and all numbers written on the blackboard must be in the range [0, 5⋅10^{18}]. It can be proven that under such restrictions the required sequence of operations exists. You can output any suitable sequence of operations.

Examples

Input


3


Output


5
3 + 3
3 ^ 6
3 + 5
3 + 6
8 ^ 9


Input


123


Output


10
123 + 123
123 ^ 246
141 + 123
246 + 123
264 ^ 369
121 + 246
367 ^ 369
30 + 30
60 + 60
120 ^ 121

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.CharBuffer;
import java.io.IOException;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.StandardCharsets;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashSet;
import java.io.UncheckedIOException;
import java.util.List;
import java.nio.charset.Charset;
import java.io.Writer;
import java.util.NoSuchElementException;
import java.io.InputStream;

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

    static class EXum {
        private static final long INF = 5_000_000_000_000_000_000L;
        private static List<EXum.Operation> ans = new ArrayList<>();

        public void solve(int testNumber, LightScanner2 in, LightWriter2 out) {
            ans.clear();
            long x = in.longs();
            solve(x);

            out.ans(ans.size()).ln();
            for (EXum.Operation op : ans) {
                out.ans(op.x).ans(op.op).ans(op.y).ln();
            }
            out.close();

            HashSet<Long> set = new HashSet<>();
            set.add(x);
            for (EXum.Operation op : ans) {
                //System.out.println(op.toString());
                if (!set.contains(op.x) || !set.contains(op.y)) throw new RuntimeException(op.toString());
                set.add(op.op == '+' ? op.x + op.y : op.x ^ op.y);
            }
            if (!set.contains(1L)) throw new RuntimeException();
        }

        private static void solve(long x) {
            long y = Long.MAX_VALUE;
            long c1 = -1, c2 = -1;
            for (long s = 3; s <= 6000; s++) {
                for (long c2t = 1; c2t < s / 2; c2t++) {
                    long c1t = s - c2t;
                    long yt = (c1t * x) ^ (c2t * x);
                    if (y <= yt) continue;

                    long g = IntMath.gcd(x, yt);
                    if (g != 1) continue;
                    y = yt;
                    c1 = c1t;
                    c2 = c2t;
                }
                if (y != Long.MAX_VALUE) break;
            }
            for (long c1t = 1; c1t <= 7; c1t++) {
                for (long c2t = 6000; c2t <= 1_000_000; c2t++) {
                    long yt = (c1t * x) ^ (c2t * x);
                    if (y <= yt) continue;
                    long g = IntMath.gcd(x, yt);
                    if (g != 1) continue;
                    y = yt;
                    c1 = c1t;
                    c2 = c2t;
                }
            }
            if (c1 == -1 || c2 == -1) throw new RuntimeException();
            //System.out.println(c1 + "/" + c2 + ",  " + x + "/" + y);

            long i1 = -1, j1 = -1, i2 = -1, j2 = -1, t1 = 0, t2 = 0;
            for (int b = 0; b <= 62; b++) {
                t1 = 1L << b;
                t2 = (1L << b) + 1;
                //System.out.println(t1 + "/" + t2);
                if (t2 < y || t1 < y) continue;

                EXum.Pair sol1 = makeNaive(x, y, t1), sol2 = makeNaive(x, y, t2);
                if (sol1 == null || sol2 == null) continue;
                i1 = sol1.x;
                i2 = sol2.x;
                j1 = sol1.y;
                j2 = sol2.y;
                break;
            }
            if (i1 == -1) throw new RuntimeException();


            //System.out.println(c1 + "/" + c2 + ",  " + i1 + "/" + j1 + ",  " + i2 + "/" + j2 + ",  " + t1 + "/" + t2);
            makseBase(x);
            mul(x, c1);
            mul(x, c2);
            ans.add(new EXum.Operation("y", c1 * x, '^', c2 * x));
            makseBase(y);
            mul(x, i1);
            mul(x, i2);
            mul(y, j1);
            mul(y, j2);
            ans.add(new EXum.Operation("t1", i1 * x, '+', j1 * y));
            ans.add(new EXum.Operation("t2", i2 * x, '+', j2 * y));
            ans.add(new EXum.Operation("ans", t1, '^', t2));
        }

        private static EXum.Pair makeNaive(long x, long y, long t) {
            if (x < y) {
                EXum.Pair p = makeNaive(y, x, t);
                return p == null ? null : new EXum.Pair(p.y, p.x);
            }
            long i1 = 0;
            long j1 = -1;
            for (; i1 * x < t; i1++) {
                j1 = (t - i1 * x) / y;
                if (i1 * x + j1 * y == t) break;
            }
            if (i1 <= 0 || j1 <= 0 || i1 * x + j1 * y != t) return null;
            return new EXum.Pair(i1, j1);
        }

        private static void makseBase(long x) {
            long t = x;
            while (t < INF / 2) {
                ans.add(new EXum.Operation("base", t, '+', t));
                t <<= 1;
            }
        }

        private static void mul(long x, long m) {
            if (Long.bitCount(m) == 1) return;
            long last = -1;
            for (int i = 0; i < 62; i++) {
                long b = 1L << i;
                if ((m & b) == 0) continue;
                if (last == -1) last = x * b;
                else {
                    ans.add(new EXum.Operation("mul", last, '+', b * x));
                    last += b * x;
                }
            }
        }

        private static class Operation {
            final String desc;
            final long x;
            final long y;
            final char op;

            public Operation(String desc, long x, char op, long y) {
                this.desc = desc;
                this.x = x;
                this.y = y;
                this.op = op;
            }

            public String toString() {
                return desc + ": " + x + " " + op + " " + y;
            }

        }

        private static class Pair {
            final long x;
            final long y;

            Pair(long x, long y) {
                this.x = x;
                this.y = y;
            }

        }

    }

    static class LightWriter2 implements AutoCloseable {
        private static final int BUF_SIZE = 16 * 1024;
        private final OutputStream out;
        private final byte[] buf = new byte[BUF_SIZE];
        private int ptr;
        private boolean autoflush = false;
        private boolean breaked = true;

        public LightWriter2(OutputStream out) {
            this.out = out;
        }

        public LightWriter2(Writer out) {
            this.out = new LightWriter2.WriterOutputStream(out);
        }

        private void allocate(int n) {
            if (ptr + n <= BUF_SIZE) return;
            try {
                out.write(buf, 0, ptr);
                ptr = 0;
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
            if (BUF_SIZE < n) throw new IllegalArgumentException("Internal buffer exceeded");
        }

        public void close() {
            try {
                out.write(buf, 0, ptr);
                ptr = 0;
                out.flush();
                out.close();
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
        }

        public LightWriter2 print(char c) {
            allocate(1);
            buf[ptr++] = (byte) c;
            breaked = false;
            return this;
        }

        public LightWriter2 ans(char c) {
            if (!breaked) print(' ');
            breaked = false;
            return print(c);
        }

        private static int countDigits(int l) {
            if (l >= 1000000000L) return 10;
            if (l >= 100000000L) return 9;
            if (l >= 10000000L) return 8;
            if (l >= 1000000L) return 7;
            if (l >= 100000L) return 6;
            if (l >= 10000L) return 5;
            if (l >= 1000L) return 4;
            if (l >= 100L) return 3;
            if (l >= 10L) return 2;
            return 1;
        }

        private static int countDigits(long l) {
            if (l >= 1000000000000000000L) return 19;
            if (l >= 100000000000000000L) return 18;
            if (l >= 10000000000000000L) return 17;
            if (l >= 1000000000000000L) return 16;
            if (l >= 100000000000000L) return 15;
            if (l >= 10000000000000L) return 14;
            if (l >= 1000000000000L) return 13;
            if (l >= 100000000000L) return 12;
            if (l >= 10000000000L) return 11;
            if (l >= 1000000000L) return 10;
            if (l >= 100000000L) return 9;
            if (l >= 10000000L) return 8;
            if (l >= 1000000L) return 7;
            if (l >= 100000L) return 6;
            if (l >= 10000L) return 5;
            if (l >= 1000L) return 4;
            if (l >= 100L) return 3;
            if (l >= 10L) return 2;
            return 1;
        }

        public LightWriter2 ans(long x) {
            allocate(24);
            if (!breaked) buf[ptr++] = ' ';
            breaked = false;

            if (x < 0) {
                buf[ptr++] = '-';
                x = -x;
            }
            int n = countDigits(x);
            for (int i = ptr + n - 1; ptr <= i; i--) {
                buf[i] = (byte) (x % 10 + '0');
                x /= 10;
            }
            ptr += n;

            return this;
        }

        public LightWriter2 ans(int x) {
            allocate(12);
            if (!breaked) buf[ptr++] = ' ';
            breaked = false;

            if (x < 0) {
                buf[ptr++] = '-';
                x = -x;
            }
            int n = countDigits(x);
            for (int i = ptr + n - 1; ptr <= i; i--) {
                buf[i] = (byte) (x % 10 + '0');
                x /= 10;
            }
            ptr += n;

            return this;
        }

        public LightWriter2 ln() {
            allocate(1);
            buf[ptr++] = '\n';
            breaked = true;
            if (autoflush) {
                try {
                    out.flush();
                } catch (IOException ex) {
                    throw new UncheckedIOException(ex);
                }
            }
            return this;
        }

        private static class WriterOutputStream extends OutputStream {
            final Writer writer;
            final CharsetDecoder decoder;

            WriterOutputStream(Writer writer) {
                this.writer = writer;
                this.decoder = StandardCharsets.UTF_8.newDecoder();
            }

            public void write(int b) throws IOException {
                writer.write(b);
            }

            public void write(byte[] b) throws IOException {
                writer.write(decoder.decode(ByteBuffer.wrap(b)).array());
            }

            public void write(byte[] b, int off, int len) throws IOException {
                writer.write(decoder.decode(ByteBuffer.wrap(b, off, len)).array());
            }

            public void flush() throws IOException {
                writer.flush();
            }

            public void close() throws IOException {
                writer.close();
            }

        }

    }

    static class LightScanner2 extends LightScannerAdapter {
        private static final int BUF_SIZE = 16 * 1024;
        private final InputStream stream;
        private final byte[] buf = new byte[BUF_SIZE];
        private int ptr;
        private int len;

        public LightScanner2(InputStream stream) {
            this.stream = stream;
        }

        private void reload() {
            try {
                ptr = 0;
                len = stream.read(buf);
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
        }

        private void load(int n) {
            if (ptr + n <= len) return;
            System.arraycopy(buf, ptr, buf, 0, len - ptr);
            len -= ptr;
            ptr = 0;
            try {
                int r = stream.read(buf, len, BUF_SIZE - len);
                if (r == -1) return;
                len += r;
                if (len != BUF_SIZE) buf[len] = '\n';
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
        }

        private void skip() {
            while (len != -1) {
                while (ptr < len && isTokenSeparator(buf[ptr])) ptr++;
                if (ptr < len) return;
                reload();
            }
            throw new NoSuchElementException("EOF");
        }

        public long longs() {
            skip();
            load(20);
            int b = buf[ptr++];
            boolean negate;
            if (b == '-') {
                negate = true;
                b = buf[ptr++];
            } else negate = false;
            long x = 0;
            for (; !isTokenSeparator(b); b = buf[ptr++]) {
                if ('0' <= b && b <= '9') x = x * 10 + b - '0';
                else throw new NumberFormatException("Unexpected character '" + b + "'");
            }
            return negate ? -x : x;
        }

        public void close() {
            try {
                stream.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        private static boolean isTokenSeparator(int b) {
            return b < 33 || 126 < b;
        }

    }

    static abstract class LightScannerAdapter implements AutoCloseable {
        public abstract void close();

    }

    static final class IntMath {
        private IntMath() {
        }

        public static long gcd(long a, long b) {
            long t;
            if (a == 0) return b;
            if (b == 0) return a;
            while (a % b > 0) {
                t = b;
                b = a % b;
                a = t;
            }
            return b;
        }

    }
}