Emma is not very tidy with the desktop of her computer. She has the habit of opening windows on the screen and then not closing the application that created them. The result is a very cluttered desktop, with some windows peeking out from behind others, and some completely hidden. Since Emma does not log off for days, this creates a formidable mess. Your task is to determine which window (if any) will be selected when Emma clicks at a certain position on the screen.
Emma's screen has a resolution of 10^6 by 10^6. When each window opens, its position is given by its upper-left-hand corner, width, and height. (Assume position is the pixel in the upper-left corner of her desktop, so the lower-right-hand pixel is at (999\,999, 999\,999).)
The input for each test case is a sequence describing the desktop. Each description consists of a line containing a positive integer , the number of windows, followed by lines (where n \leq 100), describing the windows in the order in which Emma opened them. Then, a line containing a positive integer follows, the number of queries, followed by lines, each describing a query.
Each window description line contains four integers , , , and , where is the row and column of the upper-left pixel of the window, 0 \leq r, c \leq 999\,999, and and are the width and height of the window in pixels, 1 \leq w, h. All windows are entirely on the desktop (i.e., no cropping).
Each query description line contains two integers and — the row and column number of a location on the desktop.
The last test case is followed by a line containing .
Using the format shown in the sample, for each test case, print the desktop number, beginning with , followed by lines, one per query. The -th line should say either window , where is the number of the window that was clicked, or background if the query hit none of the windows. Windows are numbered consecutively in the order in which Emma opened them, beginning with . Note that querying a window does not bring that window to the foreground on the screen.
Example 1