// Sarah Buchanan
// 7/27/11
// Solution for 2011 BHCSI programming Contest.
// 2D Active Sprite problem.

import java.util.*;
import java.io.*;

public class sprite {
	
	static final int SCREEN_WIDTH = 800;
	static final int SCREEN_HEIGHT = 600;
	static final int INF = 9999;
	
	public static void main(String[] args) throws IOException {

		Scanner fin = new Scanner(new File("sprite.in"));

		// Read in the number of input cases.
		int numcases = fin.nextInt();

		// Loop through each case.
		for (int cnt=0; cnt < numcases; cnt++) {

			// Read each object's position and dimensions
			int spriteX = fin.nextInt();
			int spriteY = fin.nextInt();
			int spriteW = fin.nextInt();
			int spriteH = fin.nextInt();
			
			// Solve and output the result.
			if (isActiveNow(spriteX, spriteY, spriteW, spriteH))
			{
				System.out.println("Case #" + (cnt + 1) + ": The sprite is active.");
			}
			else
			{
				System.out.println("Case #" + (cnt + 1) + ": The sprite is NOT active.");
			}
		}
	}
	
	// Returns true iff the sprite at (x,y) with dimensions width X height is active.
	public static boolean isActiveNow(int x, int y, int width, int height) 
	{
		//System.out.println((x+width)+" "+x+" "+(y+height)+" "+y);
		
		// Check if the ending x or y is too small, or if the beginning x or y is too big.
		if (x + width <= 0 || x >= SCREEN_WIDTH || y + height <= 0 || y >= SCREEN_HEIGHT)
		{
			return false;
		}
		
		// Otherwise it has to be active.
		return true;
	}

}