// Arup Guha
// 10/9/2015
// Solution to 2001 UCF HS Contest Problem: Bumper Planes

import java.util.*;

public class bumper {

	final public static int PLANE_R = 10;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {

			int x = stdin.nextInt();
			int y = stdin.nextInt();
			int r = stdin.nextInt();

			// Just use square of distances to avoid floating point error.
			if (x*x + y*y > (r+PLANE_R)*(r+PLANE_R))
				System.out.println("Ok");
			else
				System.out.println("Danger");
		}
	}
}