#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

set<int> dfs(vector<int> good) {
	if (good.size() == 1) {
		return set<int>({good[0]});
	}
	// split the set into two, then combine the two sets of numbers returned
	set<int> res;
	//cerr << "state: ";
	//for (int x : good) cerr << x << " ";
	//cerr << endl;
	for (int i = 0; i < (1<<good.size()); i++) {
		vector<int> left, right;
		for (int j = 0; j < good.size(); j++) {
			if ((1<<j)&i) left.push_back(good[j]);
			else right.push_back(good[j]);
		}
		if (left.empty() || right.empty()) continue;
		set<int> s = dfs(left);
		set<int> t = dfs(right);
		
		for (int x : s) {
			for (int y : t) {
				// add *
				res.insert(x*y);
				// add +
				res.insert(x+y);
				// add -
				res.insert(x-y);
				// add /
				if (y != 0 && x%y == 0) {
					res.insert(x/y);
				}
			}
		}
	}
	//cerr << "res: ";
	//for (int x : res) cerr << x << " ";
	//cerr << endl;
	return res;
}

int main() {
	ios::sync_with_stdio(0);
	int a, b, c, d;
	while (cin >> a >> b >> c >> d) {
		if (a+b+c+d == 0) break;
		vector<int> good({a, b, c, d});
		set<int> poss = dfs(good);
		
		int best = 0, last = 0xc0c0c0c0, cur = 0, st = -1, en = -1, bst, ben;
		for (int x : poss) {
			if (x == last+1) {
				cur++;
				en = x;
			} else {
				cur = 1;
				st = en = x;
			}
			last = x;
			if (cur >= best) {
				bst = st;
				ben = en;
				best = cur;
			}
		}
		
		static int ca = 0;
		cout << "Case " << ++ca << ": " << bst << " to " << ben << endl;
	}
	return 0;
}