#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

#define problem "B"

typedef long long i64;

int main() {
//	freopen(problem".in", "r", stdin);
//	freopen(problem".out", "w", stdout);
	
	int n; scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		i64 x;
		//scanf("%lld", &x);
		cin>>x;
		i64 t = (i64)sqrt((double)x);
		if (t * t < x) ++t;
		if (t * t == x) putchar('1');
		else putchar('0');
		if (i < n - 1) putchar(' ');
		else putchar('\n');
	}
	return 0;
}
