#include<stdio.h>
int main()
{
int s;
scanf("%d",&s);
while(s--)
{
int n,t=1,m=0;
scanf("%d",&n);
while(m<n)
{
m+=t;
t++;
}
t-=1;
if(t%2!=0)
printf("%d/%d\n",m-n+1,t-m+n);
else
printf("%d/%d\n",t-m+n,m-n+1);
}
return 0;
}
int main()
{
int s;
scanf("%d",&s);
while(s--)
{
int n,t=1,m=0;
scanf("%d",&n);
while(m<n)
{
m+=t;
t++;
}
t-=1;
if(t%2!=0)
printf("%d/%d\n",m-n+1,t-m+n);
else
printf("%d/%d\n",t-m+n,m-n+1);
}
return 0;
}