#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)

int main() {
  int n;
  cin >> n;
  vector<int> a(12);
  vector<char> b(12);
  for (int i=0;i<12;i++){
      a.at(i)=n%3;
      n=n/3;
  }
  for (int i=0;i<12;i++){
      if (a.at(i)==0) b.at(i)='0';
      if (a.at(i)==1) b.at(i)='+';
      if (a.at(i)==2) {a.at(i+1)++;b.at(i)='-';}
      if (a.at(i)==3) {a.at(i+1)++;b.at(i)='0';}
  }
  int t=0;
  for (int i=11;i>-1;i--){
      if (a.at(i)==0 && t==1) cout << '0';
      if (a.at(i)==1) {t=1;cout << '+';}
      if (a.at(i)==2) {t=1;cout << '-';}
      if (a.at(i)==3) cout << '0';
  }
  cout << endl;
}
