#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll __int64 int scan() { int res = 0 , ch ; while( !( ( ch = getchar() ) >= '0' && ch <= '9' ) ) { if( ch == EOF ) return 1 << 30 ; } res = ch - '0' ; while( ( ch = getchar() ) >= '0' && ch <= '9' ) res = res * 10 + ( ch - '0' ) ; return res ; } ll aa[10010],bb[10010]; int main() { ll x,y,z,i,t; scanf("%I64d",&x); while(x--) { ll a,b,c; ll ji=0,lu=0; scanf("%I64d%I64d%I64d",&a,&b,&c); for(i=1;i*i<=a;i++) { if(a%i==0) aa[ji++]=i; } for(i=1;i*i<=c;i++) { if(c%i==0) bb[lu++]=i; } int flag=0; for(i=0;i