#include using namespace std; using LL=long long; const int mo=1e9+7; LL qpow(LL a,LL b) { LL ans=1; a%=mo; while(b) { if(b&1) ans=ans*a%mo; b>>=1; a=a*a%mo; } return ans; } //----------------------------------------------------- const int maxn=1005; LL f[maxn]; LL g[maxn]; int main() { int T; scanf("%d",&T); int i,n; while(T--) { scanf("%d",&n); for(i=0;i=0;i--) { if(f[i]==0&&g[i]==0); else break; } up=f[i],down=g[i]; LL gcd=__gcd(up,down); up/=gcd,down/=gcd; printf("%lld/%lld\n",up,down); } return 0; }