#include <bits/stdc++.h>
struct MI {
 private:
  char bb[1 << 14];
  FILE* f;
  char *bs, *be;
  char e;
  bool o, l;

 public:
  MI() : f(stdin), bs(0), be(0) {}
  inline char get() {
    if (o) {
      o = 0;
      return e;
    }
    if (bs == be) be = (bs = bb) + fread(bb, 1, sizeof(bb), f);
    if (bs == be) {
      l = 1;
      return -1;
    };
    return *bs++;
  }
  inline void unget(char c) {
    o = 1;
    e = c;
  }
  template <class T>
  inline T read() {
    T r;
    *this > r;
    return r;
  }
  template <class T>
  inline MI& operator>(T&);
};
template <class T>
struct Q {
  const static bool U = T(-1) >= T(0);
  inline void operator()(MI& t, T& r) const {
    r = 0;
    char c;
    bool y = 0;
    if (U)
      for (;;) {
        c = t.get();
        if (c == -1) goto E;
        if (isdigit(c)) break;
      }
    else
      for (;;) {
        c = t.get();
        if (c == -1) goto E;
        if (c == '-') {
          c = t.get();
          if (isdigit(c)) {
            y = 1;
            break;
          };
        } else if (isdigit(c))
          break;
        ;
      };
    for (;;) {
      if (c == -1) goto E;
      if (isdigit(c))
        r = r * 10 + (c ^ 48);
      else
        break;
      c = t.get();
    }
    t.unget(c);
  E:;
    if (y) r = -r;
  }
};
template <>
struct Q<char> {};
template <class T>
inline MI& MI::operator>(T& t) {
  Q<T>()(*this, t);
  return *this;
}
template <class T>
std::ostream& operator<(std::ostream& out, const T& t) {
  return out << t;
}
using std::cout;
MI cin;
struct op {
  bool add;
  long long x, y;
};
std::vector<op> ops;
inline long long add(long long x, long long y) {
  ops.push_back({1, x, y});
  return x + y;
}
inline long long shi(long long x, long long y) {
  ops.push_back({0, x, y});
  return x ^ y;
}
inline long long op(int x, int t) {
  long long cur = x;
  for (int i = 0; i < t; ++i) cur = add(cur, cur);
  long long bit = shi(shi(add(shi(cur, x), cur), add(cur, cur)), x);
  while (bit <= cur) {
    if (cur & bit) cur = shi(cur, bit);
    bit = add(bit, bit);
  }
  return shi(cur, x);
}
int main() {
  int x = (cin.read<int>());
  for (int i = 31; i; --i)
    if ((x >> i) & 1) x = op(x, i);
  cout < ops.size() < ('\n');
  for (const auto& [add, x, y] : ops)
    cout < x < ' ' < "^+"[add] < ' ' < y < ('\n');
}
