#include <bits/stdc++.h>
using namespace std;
long long p[110];
long long a[1000000], b[1000000];
char s[1000000];
int op = 0;
map<long long, int> mp;
void add(long long x) {
  int ok = 0;
  for (int i = 55; i + 1; i--) {
    if (!(x >> i)) continue;
    if (!p[i]) {
      p[i] = x;
      ok = 1;
      break;
    }
    if (mp[x ^ p[i]] == 0) {
      ++op;
      a[op] = x, b[op] = p[i], s[op] = '^';
      mp[x ^ p[i]] = 1;
    }
    x ^= p[i];
  }
}
bool find_(long long x) {
  for (int i = 55; i + 1; i--) {
    if (!(x >> i)) continue;
    if (!p[i]) {
      return 1;
    }
    x ^= p[i];
  }
  return 0;
}
long long f[10100];
int main() {
  long long n;
  cin >> n;
  op++;
  a[op] = n, b[op] = n, s[op] = '^';
  long long m = n;
  mp[n] = 1, mp[0] = 1;
  add(n);
  f[0] = n, f[1] = n;
  int pp = 2;
  while (find_(1)) {
    n = f[pp - 2], m = f[pp - 1];
    if (mp[n + m] == 0) {
      op++;
      a[op] = n, b[op] = m, s[op] = '+';
      mp[m + n] = 1;
    }
    m += n;
    f[++pp] = m;
    add(m);
  }
  cout << op << endl;
  for (int i = 1; i <= op; i++) {
    printf("%lld %c %lld\n", a[i], s[i], b[i]);
  }
}
