#include <bits/stdc++.h>
using namespace std;
int n, k, a[1000005], x;
vector<pair<pair<long long, long long>, int> > v;
void add(long long x, long long y) {
  v.push_back(make_pair(pair<long long, long long>(x, y), 0));
}
void xr(long long x, long long y) {
  v.push_back(make_pair(pair<long long, long long>(x, y), 1));
}
void print() {
  printf("%d\n", (int)v.size());
  for (auto x : v) {
    if (x.second == 0)
      printf("%lld + %lld\n", x.first.first, x.first.second);
    else
      printf("%lld ^ %lld\n", x.first.first, x.first.second);
  }
}
int main() {
  scanf("%d", &x);
  int y;
  if (x % 4 == 3) {
    add(x, x);
    xr(x, x << 1);
    y = x ^ (x << 1);
  } else
    y = x;
  int p = 31 - __builtin_clz(y);
  long long tmp = y;
  for (int i = 0; i < p; i++) {
    add(tmp, tmp);
    tmp <<= 1;
  }
  long long l = (tmp ^ y), r = (tmp + y);
  assert(l ^ r == (1 << (p + 1)));
  add(tmp, y);
  xr(tmp, y);
  xr(l, r);
  long long m = -1;
  for (int i = 1; i <= x; i++)
    if ((1LL * i * (1 << (p + 1)) + 1) % x == 0) {
      m = i;
      break;
    }
  assert(m != -1);
  long long cur = (1LL << (p + 1));
  tmp = m;
  for (int i = 0; (1LL << i) < tmp; i++) {
    add(1LL * (1LL << i) * cur, 1LL * (1LL << i) * cur);
  }
  long long s = 0;
  for (int i = 0; (1LL << i) <= tmp; i++) {
    if (tmp & (1LL << i)) {
      if (s != 0) add(s, 1LL * (1 << i) * cur);
      s += 1LL * (1LL << i) * cur;
    }
  }
  cur = x, tmp = (1LL * m * (1 << (p + 1)) + 1) / x;
  for (int i = 0; (1LL << i) < tmp; i++) {
    add(1LL * (1 << i) * cur, 1LL * (1 << i) * cur);
  }
  s = 0;
  for (int i = 0; (1LL << i) <= tmp; i++) {
    if (tmp & (1LL << i)) {
      if (s != 0) add(s, 1LL * (1 << i) * cur);
      s += 1LL * (1LL << i) * cur;
    }
  }
  xr(1LL * m * (1LL << (p + 1)) + 1, 1LL * m * (1LL << (p + 1)));
  print();
  return 0;
}
