#include <bits/stdc++.h>
using namespace std;
void input(vector<int>& v, int n) {
  int i, io;
  for (i = 0; i < n; i++) {
    cin >> io;
    v.push_back(io);
  }
}
void output(vector<int> v) {
  int i;
  for (i = 0; i < v.size(); i++) cout << v.at(i) << " ";
}
map<int, int> frequency(vector<int> v) {
  int i;
  map<int, int> m;
  for (i = 0; i < v.size(); i++) {
    if (m.find(v[i]) == m.end())
      m.insert({v.at(i), 1});
    else
      m[v.at(i)]++;
  }
  return m;
}
bool perfsq(long long n) { return (ceil(sqrt(n)) == floor(sqrt(n))); }
bool ispower2(int n) {
  if (n & (n - 1) == 0)
    return true;
  else
    return false;
}
int string_to_int(string s) {
  stringstream geek(s);
  int x = 0;
  geek >> x;
  return x;
}
bool binary_pred(int a, int b) { return a == b; }
void getans() {
  string s;
  cin >> s;
  if (min(count(s.begin(), s.end(), '1'), count(s.begin(), s.end(), '0')) % 2)
    cout << "DA" << endl;
  else
    cout << "NET" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T = 1;
  cin >> T;
  while (T--) getans();
}
