#include <bits/stdc++.h>
using namespace std;
bool valid(long long x)
{
while (x)
{
int d = x % 10;
if (d == 4)
return false;
x /= 10;
}
return true;
}
int main()
{
srand(time(NULL));
int tests;
cin >> tests;
for (int t = 1; t <= tests; t++)
{
long long N, A, B;
cin >> N;
long long _min = 1, _max = N - 1;
while (true)
{
A = (_min + (rand() % (long long)(_max - _min + 1)));
B = N - A;
if (valid(A) && valid(B))
{
cout << "Case #" << t << ": " << A << " " << B << endl;
break;
}
}
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpib29sIHZhbGlkKGxvbmcgbG9uZyB4KQp7Cgl3aGlsZSAoeCkKCXsKCQlpbnQgZCA9IHggJSAxMDsKCQlpZiAoZCA9PSA0KQoJCQlyZXR1cm4gZmFsc2U7CgkJeCAvPSAxMDsKCX0KCXJldHVybiB0cnVlOwp9CgppbnQgbWFpbigpCnsKCXNyYW5kKHRpbWUoTlVMTCkpOwoJaW50IHRlc3RzOwoJY2luID4+IHRlc3RzOwoJZm9yIChpbnQgdCA9IDE7IHQgPD0gdGVzdHM7IHQrKykKCXsKCQlsb25nIGxvbmcgTiwgQSwgQjsKCQljaW4gPj4gTjsKCQlsb25nIGxvbmcgX21pbiA9IDEsIF9tYXggPSBOIC0gMTsKCQl3aGlsZSAodHJ1ZSkKCQl7CgkJCUEgPSAoX21pbiArIChyYW5kKCkgJSAobG9uZyBsb25nKShfbWF4IC0gX21pbiArIDEpKSk7CgkJCUIgPSBOIC0gQTsKCQkJaWYgKHZhbGlkKEEpICYmIHZhbGlkKEIpKQoJCQl7CgkJCQljb3V0IDw8ICJDYXNlICMiIDw8IHQgPDwgIjogIiA8PCBBIDw8ICIgIiA8PCBCIDw8IGVuZGw7CgkJCQlicmVhazsKCQkJfQoJCX0KCX0KfQo=