#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;

//#define int long long
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;
const bool DEBUG = false;

signed main() {
	int a[12] = { 1 };
	int b[12] = {};
	rep(i, 1, 12) a[i] = a[i - 1] + pow(3, i);
	rep(i, 0, 12) b[i] = pow(3, i);
	dumpc(a);
	dumpc(b);
	for (int w; cin >> w;) {
		int cnt[12] = {};
		int head;
		rep(i, 0, 12)if (w <= a[i]) {
			w = a[i] - w;
			head = i + 1;
			break;
		}
		dump(w);
		rrep(i, 0, 12) {
			if (b[i] <= w) {
				w -= b[i]; cnt[i]++;
			}
			if (b[i] <= w) {
				w -= b[i]; cnt[i]++;
			}
		}
		dump(w);
		dumpc(cnt);
		rrep(i, 0, head) {
			if (cnt[i] == 0) cout << "+";
			else if (cnt[i] == 1) cout << "0";
			else cout << "-";
		}
		cout << endl;
	}
	return 0;
}