#include <iostream>
#include <map>
#include <vector>

using namespace std;
typedef vector<int> vi;

void dfs(vi num, string ops,
        int &optpos1, int &opt1, int &optpos2, int &opt2) {
    /*
    for (int i = 0; i < num.size(); i++) {
        cerr << num[i] << " ";
        if (i+1 < num.size()) cerr << ops[i] << " ";
    }
    cerr << endl;
    */

    if (num.size() == 1) {
        optpos1 = optpos2 = 0;
        opt1 = opt2 = num[0];
        return;
    }
    optpos1 = optpos2 = 0;
    opt1 = -2147483648;
    opt2 = 2147483647;
    for (int i = 0; i < ops.length(); i++) {
        vi nxt;
        string nxtops;
        int res11, res12, res21, res22;
        for (int j = 0; j < num.size(); j++) {
            if (j == i) {
                char op = ops[i];
                int z = 0;
                if (op == '+') z = num[i]+num[i+1];
                else if (op == '-') z = num[i]-num[i+1];
                else if (op == '*') z = num[i]*num[i+1];
                nxt.push_back(z);
                if (j+1 < ops.length()) nxtops += ops[j+1];
                j++;
            } else {
                nxt.push_back(num[j]);
                if (j < ops.length()) nxtops += ops[j];
            }
        }
        dfs(nxt, nxtops, res11, res12, res21, res22);
        if (res22 > opt1) {
            optpos1 = i;
            opt1 = res22;
        }
        if (res12 < opt2) {
            optpos2 = i;
            opt2 = res12;
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int ncase; cin >> ncase;
    for (int csnum = 1; csnum <= ncase; csnum++) {
        int m; cin >> m; m++;
        vi nums(m, 0);
        string ops(m-1, ' ');

        for (int i = 0; i < m; i++) {
            cin >> nums[i];
            if (i+1 < m) cin >> ops[i];
        }

        int r11, r12, r21, r22;
        dfs(nums, ops, r11, r12, r21, r22);
        cout << "Case " << csnum << ":" << endl;
        cout << "Player 1 (" << nums[r11] << ops[r11] << nums[r11+1] << ") leads to " << r12 << endl;
        cout << "Player 2 (" << nums[r21] << ops[r21] << nums[r21+1] << ") leads to " << r22 << endl;
        if (r12 > -r22) cout << "Player 1 wins" << endl;
        else if (r12 < -r22) cout << "Player 2 wins" << endl;
        else cout << "Tie" << endl;
    }
}