import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto s = readln.strip;
		auto balance = abs (s.count ('0').to !(int) -
		    s.count ('1').to !(int));
		auto moves = (s.length - balance) / 2;
		writeln ((moves & 1) ? "DA" : "NET");
	}
}
