#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	int N; cin >> N;
	int a = 1;
	for (int i = 0; i < a; ++i) {
		
		vector<int>nums;
		while (N) {
			nums.push_back(N % 3);
			N /= 3;
		}
		nums.push_back(0);
		reverse(nums.begin(), nums.end());
		for (int i = nums.size()-1; i >=0; --i) {
			if (nums[i] >= 2) {
				nums[i - 1] ++;
				nums[i] -=3;
			}
		}
		if (*nums.begin() == 0)nums.erase(nums.begin());
		for (auto n : nums) {
			if (n == 0)cout << '0';
			else if (n == 1)cout << '+';
			else if (n == -1)cout << '-';
			else assert(false);
		}
		cout << endl;
	}
	
	return 0;
}