#include #include #include void play(std::vector &a) { const int n = a.size(); std::unordered_set table; for (int i = 0; i < n; i++) { bool flag = false; while (a[i] % 2 == 0) { flag = !flag; a[i] /= 2; } if (table.find(2) != table.end() && flag) { table.erase(2); } else if (flag) { table.insert(2); } for (int p = 3; p * p <= a[i]; p += 2) { bool flag = false; while (a[i] % p == 0) { flag = !flag; a[i] /= p; } if (table.find(p) != table.end() && flag) { table.erase(p); } else if (flag) { table.insert(p); } } if (a[i] > 1) { if (table.find(a[i]) != table.end()) { table.erase(a[i]); } else { table.insert(a[i]); } } std::cout << (table.empty() ? "da" : "ne") << std::endl; } } int main(void) { unsigned n; std::cin >> n; std::vector a(n); for (int i = 0; i < n; i++) { std::cin >> a[i]; } play(a); return 0; }