#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { cin.tie(0)->sync_with_stdio(0); ll N; cin >> N; string ans = ""; set st; st.insert(N); while (N != 1) { if (N % 2 == 0) { N /= 2; ans += "/"; } else if (N * 3 - 1 > 0 && st.find(N * 3 - 1) == st.end()) { N = N * 3 - 1; ans += "-"; } else { N = N * 3 + 1; ans += "+"; } st.insert(N); } cout << ans.size() << "\n"; cout << ans << "\n"; return 0; }