#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
map<ll, tuple<ll, char, ll>> op;
struct GF2 {
  vector<ll> span;
  bool insert(ll x) {
    if (!x) return false;
    for (ll y : span) {
      if (x == 0 || x == y) {
        x = 0;
        break;
      }
      int lx = __builtin_clzll(x);
      int ly = __builtin_clzll(y);
      if (lx < ly) break;
      if (lx == ly) {
        ll z = x ^ y;
        if (!op.count(z)) {
          op[z] = {x, '^', y};
          ;
        }
        x = z;
      }
    }
    if (x) {
      span.push_back(x);
      sort(span.rbegin(), span.rend());
      return true;
    }
    return false;
  }
  bool check() { return !span.empty() && span.back() == 1; }
  int dim() {
    if (span.empty()) return 0;
    ll x = span.front();
    int d = 0;
    while (x > 0) {
      d++;
      x >>= 1;
    }
    return d;
  }
  int gap() { return dim() - span.size(); }
};
vector<string> ans;
map<ll, bool> seen;
void generate(ll x) {
  if (seen[x]) return;
  seen[x] = true;
  assert(op.count(x));
  auto [l, o, r] = op[x];
  generate(l);
  generate(r);
  ans.push_back(to_string(l) + " " + string(1, o) + " " + to_string(r));
}
const ll INF = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll x;
  cin >> x;
  seen[x] = true;
  if (x % 4 == 3) {
    ll x2 = x + x;
    op[x2] = {x, '+', x};
    op[x2 ^ x] = {x, '^', x2};
    x = x ^ x2;
  }
  assert(x % 4 == 1);
  GF2 vs;
  vs.insert(x);
  while (!vs.check()) {
    auto cur = vs.span;
    for (ll u : cur) {
      for (ll v : cur) {
        if (!op.count(u + v)) {
          op[u + v] = {u, '+', v};
          vs.insert(u + v);
          if (vs.check()) break;
        }
        if (vs.check()) break;
      }
    }
  }
  assert(op.count(1));
  generate(1);
  cout << ans.size() << '\n';
  for (auto &s : ans) {
    cout << s << '\n';
  }
  return 0;
}
