#include <bits/stdc++.h>
using namespace std;
int i, j, m, n, rev_dig[25], cnt, non_zero, anscnt;
long long x, ans1[100005], ans2[100005], ans3[100005];
long long getinv(long long a, long long p) {
  if (a == 1) return 1;
  long long k = a - getinv(p % a, a);
  return (k * p + 1) / a;
}
void answer(long long a, long long b, int ty) {
  anscnt++;
  ans1[anscnt] = a;
  ans2[anscnt] = b;
  ans3[anscnt] = ty;
}
void getmul(int t, long long x) {
  long long temp = 1;
  long long xx = x;
  while (temp < t) {
    answer(xx, xx, 1);
    xx <<= 1;
    temp <<= 1;
  }
  temp = 1;
  long long now = 0;
  while (temp <= t) {
    if (temp & t) {
      if (now > 0) {
        answer(temp * x, now, 1);
        now += temp * x;
      } else {
        now = temp * x;
      }
    }
    temp <<= 1;
  }
}
int main() {
  anscnt = 0;
  scanf("%lld", &x);
  if (x % 4 == 1) {
    answer(x, x, 1);
    answer(x, x * 2, 1);
    x *= 3;
  }
  cnt = 0;
  long long xx = x;
  while (xx > 0) {
    cnt++;
    rev_dig[cnt] = xx & 1;
    xx >>= 1;
  }
  non_zero = 0;
  for (i = 1; i <= cnt; i++) {
    if (rev_dig[i] == 0) {
      non_zero = i;
      break;
    }
  }
  if (non_zero == 0) {
    cnt++;
    rev_dig[cnt] = 0;
    non_zero = cnt;
  }
  long long xinv = getinv(x, 1 << cnt);
  long long r1 = x - 1;
  long long t1 = r1 * xinv % (1 << cnt);
  getmul(t1, x);
  long long b = t1 * x;
  answer(b, x, 2);
  long long c = b ^ x;
  answer(x, c, 1);
  long long d = (x + c);
  answer(b, d, 2);
  long long e = b ^ d;
  if (e != 2) {
    long long r2 = x - 2;
    long long t2 = r2 * xinv % (1 << cnt);
    getmul(t2, x);
    long long b2 = t2 * x;
    answer(b2, x, 2);
    long long c2 = b2 ^ x;
    answer(x, c2, 1);
    long long d2 = (x + c2);
    answer(b2, d2, 2);
    long long e2 = b2 ^ d2;
    answer(e, e2, 2);
  }
  e = 2;
  while (e <= x) {
    answer(e, e, 1);
    if (e & x) {
      answer(e, x, 2);
      x = e ^ x;
    }
    e <<= 1;
  }
  printf("%d\n", anscnt);
  for (i = 1; i <= anscnt; i++) {
    if (ans3[i] == 1) {
      printf("%lld + %lld\n", ans1[i], ans2[i]);
    } else {
      printf("%lld ^ %lld\n", ans1[i], ans2[i]);
    }
  }
  return 0;
}
