#include #include #include #include #include #include using namespace std; using ll = long long; using P = pair; int main(){ ll n; cin >> n; map mem; map pre; queue Q; Q.emplace(n); mem[n] = 0; while(!Q.empty()){ ll cur = Q.front(); Q.pop(); if(cur == 1) break; if(cur%2 == 0){ if(mem.count(cur/2) == 1) continue; mem[cur/2] = mem[cur]+1; pre[cur/2] = cur; if(cur/2 == 1) break; Q.emplace(cur/2); }else{ for(auto &it: {cur*3+1}){ if(mem.count(it) == 1) continue; mem[it] = mem[cur]+1; pre[it] = cur; if(it == 1) break; Q.emplace(it); } } } string ans = ""; ll x = 1; while(x != n){ ll p = pre[x]; if(x*2 == p) ans += "/"; else if(p*3+1 == x) ans += "+"; else ans += "-"; x = p; } reverse(ans.begin(), ans.end()); cout << ans.size() << endl; cout << ans << endl; return 0; }