#include <stdio.h>

int main (){

  int i, n;

  scanf("%d", &n);



  int a, multi;

  for(i=0; i<n; ++i){

    scanf("%d", &a);

    multi = a * a;

    if(multi < 1000000000000000000){

      printf("%d", multi);

    }else{

      printf('-1');

    }

   }

  return 0;

}

  






  


 

   

    


 

    

      

    

   

  



  