시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB36211862.069%

문제

Domagoj loves drawing horses at leisure. For a long time, he's been a proud member of social groups dealing with this subject. But Domagoj is a very special boy, so because of his drawing technique most people do not understand his masterpieces.

One of his most famous drawings is "#define HORSE 42-42", also known as "Ordinary Horse".

15
2 2 6 2
2 2 2 6
6 2 6 4
6 4 6 6
2 6 6 6
6 2 8 2
8 2 10 2
10 2 12 2
12 2 12 4
12 4 6 4
6 2 6 1
8 2 8 0
10 2 10 1
12 2 12 0
42 42 42 43
2 2

You must be wondering "Where is that horse?" and "Is everything all right with Domagoj?" because you only see some numbers on the drawing. The first question will be answered in the next section, while the answer to the second question also interests the author of this task.

In order to understand the drawing, you need to understand Domagoj's drawing technique. The first number in the drawing is the number N denoting the number of line segments that may have been drawn. Thereafter, the following N lines have four numbers, Ai, Bi, Ci and Di, which describe the ith line segment extending from the point (Ai, Bi) to the point (Ci, Di). In the last line of the drawing there are two numbers, X and Y, the coordinates of point T. Domagoj will draw all the line segments that contain the point T and all that are directly or indirectly connected to a line segment that contains point T. For two line segments L1 and L2 we say that they are directly connected if they have a common end point, and they are indirectly connected if there is a sequence of line segments L1, H1, H2, … Hk, L2 such that the line segments L1 and H1 are directly connected, H1 and H2 are directly connected, ..., Hk and L2 are directly connected.

Your task is to print a rectangular matrix P of characters that displays Domagoj's drawing. The value of Pa,b should be set to '#' if the point with the coordinates (a, b) is part of some line segment drawn, otherwise this value should be set to '.'. Coordinate a in the matrix rises from left to right, while coordinate b rises from bottom up. Matrix P should contain all points that are part of a drawn lines and should not contain any single row or column that contains only characters '.', i.e. it should be minimal in size.

입력

In the first line of the input there is a positive integer N (1 ≤ N ≤ 200 000).

In the next N lines there four non-negative integers Ai, Bi, Ci and Di (0 ≤ Ai, Bi, Ci, Di ≤ 300). For each line segment it will hold either Ai ≠ Ci or Bi ≠ Di. No two line segments will intersect, but some might have common end point. All the will be parallel to the coordinate axes.

In the last line of the input there will be two non-negative integers X and Y, coordinates of the point T. Point T will be part of at least one of the given line segment.

출력

Print required matrix P from the task.

예제 입력 1

15
2 2 6 2
2 2 2 6
6 2 6 4
6 4 6 6
2 6 6 6
6 2 8 2
8 2 10 2
10 2 12 2
12 2 12 4
12 4 6 4
6 2 6 1
8 2 8 0
10 2 10 1
12 2 12 0
42 42 42 43
2 2

예제 출력 1

#####......
#...#......
#...#######
#...#.....#
###########
....#.#.#.#
......#...#

In the first example all the line segments should be drawn except the last.

예제 입력 2

6
1 1 10 1
10 1 10 3
10 3 1 3
1 3 1 1
10 3 11 3
11 3 11 6
2 1

예제 출력 2

..........#
..........#
..........#
###########
#........#.
##########.

In the second example all the line segments should be drawn to get the drawing of the name "Summarized horse".