#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
template <class T>
inline T fast(T a, T b, T mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return abs(a);
}
const long long INF = 1e9 + 7;
const long long mod = 998244353;
const long long BIG_INF = 1e18 + 7;
const long long N = 1e6 + 7;
const long long T = 1 << 20;
const long double inf = 1e18;
const int MLIM = 10000000;
bitset<MLIM + 7> mam;
int LIM;
vector<string> op;
void wypisz() {
  cout << (int)(op).size() << '\n';
  for (auto &u : op) {
    cout << u << '\n';
  }
}
void dodaj(vector<long long> &baza, long long val) {
  for (int i = 62; i >= 0; i--) {
    if (val & (1ll << i)) {
      if (!baza[i]) {
        baza[i] = val;
        return;
      } else {
        op.push_back(to_string(val) + " ^ " + to_string(baza[i]));
        val = val ^ baza[i];
      }
    }
  }
}
bool baza_contains(vector<long long> &baza, long long val) {
  for (int i = 62; i >= 0; i--) {
    if (val & (1ll << i)) {
      if (baza[i] == 0) {
        return false;
      } else
        val = val ^ baza[i];
    }
  }
  return true;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> baza(64);
  dodaj(baza, n);
  while (baza[0] == 0) {
    bool found = 0;
    for (int i = 0; i < 63; i++) {
      for (int j = i; j < 63; j++) {
        if (baza[i] and baza[j] and baza[i] + baza[j] < BIG_INF and
            !baza_contains(baza, baza[i] + baza[j])) {
          op.push_back(to_string(baza[j]) + " + " + to_string(baza[i]));
          dodaj(baza, baza[i] + baza[j]);
          found = true;
          break;
        }
      }
      if (found) break;
    }
  }
  wypisz();
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
}
