#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 = ""; while (N != 1) { if (N % 2 == 0) { N /= 2; ans += "/"; } else { ll tmp = 3 * N + 1; int cnt1 = 0; while (tmp % 2 == 0) { tmp /= 2; cnt1++; } tmp = 3 * N - 1; int cnt2 = 0; while (tmp % 2 == 0) { tmp /= 2; cnt2++; } if (cnt1 > cnt2) { N = 3 * N + 1; ans += "+"; } else { N = 3 * N - 1; ans += "-"; } } } cout << ans.size() << "\n"; cout << ans << "\n"; return 0; }