#include "iostream"
using namespace std;

int N;
char ans[20];
int num;

int main() {
	cin >> N;
	while (N != 0) {
		if (N % 3 == 0) {
			ans[num++] = '0';
		}
		else if (N % 3 == 1) {
			ans[num++] = '+';
			N--;
		}
		else {
			ans[num++] = '-';
			N++;
		}
		N /= 3;
	}
	for (int i = num-1; i >= 0; i--) {
		cout << ans[i];
	}
	cout << "\n";
	return 0;
}