#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

const ll MOD = INF;


int main(){
    int w;
    cin>>w;
    
    string s = "";
    while(w>0){
        if(w%3==0)s+='0';
        if(w%3==1)s+='+';
        if(w%3==2){
            s+='-';
            w+=1;
        }
        w/=3;
    }
    
    reverse(all(s));
    cout<<s<<endl;
}