/* -*- coding: utf-8 -*- * * 2426.cc: No.2426 Select Plus or Minus - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_K = 10000; /* typedef */ typedef long long ll; /* global variables */ char s[MAX_K + 4]; /* subroutines */ /* main */ int main() { ll n; scanf("%lld", &n); int k = 0; while (! (n & 1)) s[k++] = '/', n >>= 1; while (n > 1) { ll n0 = 3 * n + 1, n1 = 3 * n - 1; while (! (n0 & 1)) n0 >>= 1; while (! (n1 & 1)) n1 >>= 1; if (n0 < n1) s[k++] = '+', n = 3 * n + 1; else s[k++] = '-', n = 3 * n - 1; while (! (n & 1)) s[k++] = '/', n >>= 1; } s[k] = '\0'; printf("%d\n", k); puts(s); return 0; }