爆 long long 了
#include <bits/stdc++.h>
using i64 = long long;
i64 cnt;
void solve() {
i64 x, y;
std::cin >> x >> y;
cnt ++;
std::cout << "Case " << cnt << ": " << x / std::__gcd(x, y) * y << "\n";
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
std::cin >> t;
while (t --) {
solve();
}
return 0;
}