#include <bits/stdc++.h>
using namespace std;
int main()
{
int p1, p2, a, b, c;
cin >> p1 >> p2 >> a >> b >> c;
if (p1 > p2 && (a + b + c) < 3 || p1 < p2 && (a + b + c) == 0)
printf("The winner is a: %d + %d", p1, 3 - a - b - c);
else
printf("The winner is b: %d + %d", p2, a + b + c);
return 0;
}