cum, i = [0], 0
while cum.last < 100000
    cum << 3 ** i
    i += 1
end
1.upto(cum.length - 1){|i| cum[i] += cum[i - 1]}

w, str, h = gets.to_i, "", {0=>'0', 1=>'+', 2=>'-'}
cum.each_with_index{|offset, i|
    break if offset >= w
    x, r = (w + cum[i]).divmod 3
    i.times{x, r = x.divmod 3}
    str = h[r] + str
}
puts str
