// Arup Guha
// 3/19/2026
// Solution to 2026 UCF HS Contest Problem K: Stonk Trading

import java.util.*;
import java.io.*;

public class stonks {

	public static void main(String[] args) throws Exception {
	
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		
		// sets[i] will store each day price was recorded as i.
		TreeSet<Integer>[] sets = new TreeSet[101];
		for (int i=0; i<=100; i++)
			sets[i] = new TreeSet<Integer>();
			
		// Store each recording as designated above.
		int n = Integer.parseInt(stdin.readLine());
		for (int i=0; i<n; i++) {
			StringTokenizer tok = new StringTokenizer(stdin.readLine());
			int day = Integer.parseInt(tok.nextToken());
			int val = Integer.parseInt(tok.nextToken());
			sets[val].add(day);
		}
		
		StringBuffer sb = new StringBuffer();
		int q = Integer.parseInt(stdin.readLine());
		
		// Process queries.
		for (int i=0; i<q; i++) {
			StringTokenizer tok = new StringTokenizer(stdin.readLine());
			int val = Integer.parseInt(tok.nextToken());
			int lo = Integer.parseInt(tok.nextToken());
			int hi = Integer.parseInt(tok.nextToken());
		
			// Get the lowest recorded value in days [lo,hi].
			Integer min = null, max = null;
			min = getMin(sets, lo, hi);
			
			// If there's a min, get the max for the same range of days.
			if (min != null) max = getMax(sets, lo, hi);
			
			// Add to buffer accordingly.
			if (min != null && val >= min && val <= max)
				sb.append("Stonks!\n");
			else
				sb.append("Not Necessarily Stonks!\n");
		}
		
		// Ta da!
		System.out.print(sb);
	}
	
	// Returns minimum recorded value days lo to hi.
	public static Integer getMin(TreeSet<Integer>[] sets, int lo, int hi) {
	
		// Try each value in order.
		for (int i=1; i<=100; i++) {
			
			// Find the next day with this exact reading, day lo or higher.
			Integer next = sets[i].higher(lo-1);
			
			// We recorded this value in the day range., return it!
			if (next != null && next <= hi)
				return i;
		}
		
		// Never found it.
		return null;
	}
	
	// Returns maximum recorded value days lo to hi.
	public static Integer getMax(TreeSet<Integer>[] sets, int lo, int hi) {
	
		// Try each value in order.
		for (int i=100; i>=1; i--) {
			
			// Find the next day with this exact reading, day lo or higher.
			Integer next = sets[i].higher(lo-1);
			
			// We recorded this value in the day range., return it!
			if (next != null && next <= hi)
				return i;
		}
		
		// Never found it.
		return null;
	}
}