#include<iostream>
#include<cmath>
using namespace std;

int n;
int v[15];
int sum;
char T[4] = "-0+";

int main() {
	cin >> n;
	for (int i = 0; i < 531441; i++) {
		sum = 0;
		for (int j = 0; j < 12; j++) {
			v[j] = (i / (int)(pow(3, j))) % 3;
			sum += (v[j] - 1)*(int)(pow(3, j));
		}
		bool ok = false;
		if (sum == n) {
			for (int j = 11; j >= 0; j--) {
				if (v[j] >= 2) {
					ok = true;
				}
				if (ok == true) {
					cout << T[v[j]];
				}
			}
		}
	}
	cout << endl;
	return 0;
}