#ifndef hari64 #include // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #define debug(...) #else #include "util/viewer.hpp" #define debug(...) viewer::_debug(__LINE__, #__VA_ARGS__, __VA_ARGS__) #endif // clang-format off using namespace std; template using vc = vector; template using vvc = vector>; template using vvvc = vector>; using ll = long long; using ld = long double; using pii = pair; using pll = pair; using tiii = tuple; using tlll = tuple; using vi = vc; using vvi = vvc; using vvvi = vvvc; using vll = vc; using vvll = vvc; using vvvll = vvvc; using vb = vc; using vvb = vvc; using vvvb = vvvc; using vpii = vc; using vvpii = vvc; using vpll = vc; using vvpll = vvc; using vtiii = vc; using vvtiii = vvc; using vtlll = vc; using vvtlll = vvc; #define ALL(x) begin(x), end(x) #define RALL(x) (x).rbegin(), (x).rend() constexpr int INF = 1001001001; constexpr long long INFll = 1001001001001001001; template bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; } template bool chmin(T& a, const T& b) { return a > b ? a = b, 1 : 0; } // clang-format on int main() { cin.tie(0); ios::sync_with_stdio(false); ll N; cin >> N; set seen; vc path; vc ans; auto dfs = [&](const auto& f, ll x) -> void { debug(x); if (!ans.empty()) return; if (seen.count(x)) return; if (x == 1) { ans = path; return; } seen.insert(x); if (x % 2 == 0) { path.push_back('/'); f(f, x / 2); path.pop_back(); } else { if (x < (ll)1e18 / 3) { path.push_back('+'); f(f, 3 * x + 1); path.pop_back(); path.push_back('-'); f(f, 3 * x - 1); path.pop_back(); } } }; dfs(dfs, N); cout << ans.size() << endl; for (auto& elem : ans) cout << elem << ' '; cout << endl; return 0; }