#include<iostream>
#include<math.h>
using
namespace
std;
int
main()
{
int
t,n;
int
a,b;
int
p,q,flag;
cin>>t;
while
(t--)
{
flag=0;
cin>>n;
for
(p=
int
(
sqrt
(1.0*n));p>=1;p--)
{
q=n/p;
if
(n%p==0&&(p+q)%2==0)
{
if
((p+q)/2>(q-p)/2)
{
a=(p+q)/2;
b=(q-p)/2;
flag++;
break
;
}
}
}
if
(flag==0)
cout<<
"IMPOSSIBLE"
<<endl;
else
cout<<b<<
" "
<<a<<endl;
}
return
0;
}