#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
using namespace std;

const int SIZE = 1e3 + 5;

int dp[SIZE][2][2];
int a[3];

int dfs(int now, int nowplayer, int otherplayer)
{
    if (dp[now][nowplayer][otherplayer])
    {
        return dp[now][nowplayer][otherplayer];
    }

    if (now < a[0])
    {
        if ((nowplayer & 1) == (otherplayer & 1))
            return -1; //平
        if (nowplayer & 1)
            return 1; //胜
        return 2;     //负
    }

    else
    {
        bool noplayerwin = false;
        for (int i = 2; i >= 0; i--)
        {
            if (a[i] > now)
                continue;
            else
            {
                int otherresult = dfs(now - a[i], otherplayer, (nowplayer + a[i]) & 1);
                if (otherresult == 2)
                    return dp[now][nowplayer][otherplayer] = 1;
                if (otherresult == -1)
                    noplayerwin = true;
            }
        }
        if (noplayerwin)
            return dp[now][nowplayer][otherplayer] = -1;
        return dp[now][nowplayer][otherplayer] = 2;
    }
}

int main()
{
    int maxnum;
    memset(dp, 0, sizeof(dp));
    cin >> a[0] >> a[1] >> a[2];
    sort(a, a + 3);
    for (int i = 1; i <= 5; i++)
    {
        cin >> maxnum;
        switch (dfs(maxnum, 0, 0))
        {
        case 1:
            cout << "+ ";
            break;
        case 2:
            cout << "- ";
            break;
        case -1:
            cout << "0 ";
            break;
        }
    }
    return 0;
}
