#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
long long int A,B,D,E,R;
string C;
cin>>A;
cin>>C;
cin>>B;
D=A;
E=B;
do{
R=A%B;
A=B;
B=R;
}while(R!=0);
cout<<D/A<<" "<<C<<" "<<E/A<<endl;
}
return 0;
}
#include
using namespace std;
int main(){
int n;
cin>>n;
while(n--){
long long int A,B,D,E,R;
string C;
cin>>A;
cin>>C;
cin>>B;
D=A;
E=B;
do{
R=A%B;
A=B;
B=R;
}while(R!=0);
cout<<D/A<<" "<<C<<" "<<E/A<<endl;
}
return 0;
}
範圍是10^30喔
不是2^30