#include using namespace std; const int maxn = 1010; int gcd(int a,int b) {if (a==0) return b; else return b==0?a:gcd(b,a%b);} int f[maxn],g[maxn]; int main(void) { int T; scanf("%d",&T); while (T--) { int n; scanf("%d",&n); for (int i=0;i=0;i--) if (f[i] || g[i]) {a=f[i],b=g[i];break;} int g=gcd(a,b); printf("%d/%d\n",a/g,b/g); } return 0; }