#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n';
bool custom(pair<int,int>a, pair<int,int>b){
if(a.first == b.first){
return a.second > b.second;
}
return a.first < b.first;
}
void tc(){
int t;
cin >> t;
while (t--){
ll a,u;
cin >> a >> u;
if(u == 0){
cout << "Game #"<< t+1 << ": "<< "0/1" << endl;
}
else if(a == u){
cout << "Game #"<< t+1 << ": " << "1/1" << endl;
}
else{
ll gcd = __gcd(a,u);
cout << "Game #"<< t+1 << ": "<< u/gcd << '/' << a/gcd << endl;
}
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
tc();
return 0;
}