시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

You have come into possession of an irregularly-shaped piece of a stained-glass mosaic. Although the overall piece is damaged from years of storage, and missing many parts around the border, you think it would be quite nice to keep a small part of this delightful object as a souvenir.

You will find a perfectly-square subregion of this mosaic and prise it out—but only by removing pieces along the existing lines between glass panes, never by cutting into the glass.

Figure G.1: A visualisation of the first sample input. You can take a 5 × 5cm piece out from the upper-right corner.

Glass is cumbersome and you’d rather not take more than necessary. What’s the smallest square you can take out as one piece without damaging the glass?

입력

The input consists of:

  • One line containing the integer n (1 ≤ n ≤ 1 00000000), the number of pieces of glass.
  • n further lines, each containing the integers x0 y0 x1 y1 (0 ≤ x, y ≤ 1 00000000), the coordinates in centimetres of the lower-left and upper-right corner of one piece per line.

It is guaranteed that none of the given pieces of glass intersect.

출력

Output the area of the smallest square that you can remove along existing lines, in centimetres squared. If it is not possible to remove any square at all, output impossible instead.

예제 입력 1

13
20 16 22 19
20 15 22 16
19 14 22 15
10 10 12 20
12 10 20 14
12 14 17 15
19 15 20 18
17 18 20 19
12 19 20 20
12 15 17 17
12 17 17 18
12 18 17 19
17 14 19 18

예제 출력 1

25

예제 입력 2

4
0 0 1 9
1 0 9 1
1 8 9 9
8 1 9 8

예제 출력 2

impossible