Rocky Oil owns several rectangular oil fields and is drilling new wells in them. In each field it wants to connect every well to a single East–West (E–W) pipeline using straight North–South (N–S) pipes. Your program must first find the position of the E–W pipeline that makes the total length of the N–S pipes as small as possible, and then, if possible, draw a map of the field.
Each field is a grid that is 94 units long in the E–W direction and 73 units long in the N–S direction. Coordinates are integers, with the SW corner at $(1, 1)$ and the NE corner at $(94, 73)$. A well may sit at any integer coordinate inside the grid, and no two wells share a position. The E–W pipeline runs straight across the whole field at some integer N–S coordinate. All wells that share the same E–W coordinate are connected by one common N–S pipe. If several N–S positions give the same minimal total length, choose the southernmost one (the smallest N–S coordinate).
For one E–W column, the N–S pipe must reach from the E–W pipeline to every well in that column, so its length is the distance from the lower of (the pipeline, the lowest well) to the higher of (the pipeline, the highest well). The total pipe length is the sum over all E–W columns that contain wells.
For example, placing the pipeline at N–S coordinate 11 puts the well at E–W position 1 exactly on the pipeline (length 0), while the two wells at E–W position 69 share one pipe of length 18, for a total of 18. Placing it at 20 also gives 18, and in fact every position from 11 to 20 is minimal; the southernmost, 11, is chosen.
If a map can be drawn, it must fit within 69 columns and 19 rows, not counting the border and labels. The map shows the E–W pipeline, all wells, and all N–S pipes. Only the part of the field containing wells is drawn, using the smallest bounding rectangle whose four edges are all multiples of 5; every well lies strictly inside this rectangle, never on an edge. The E–W pipeline always spans the full width of the map. If the required rectangle is larger than 69 columns or 19 rows, the field cannot be drawn.
The input describes one or more oil fields and ends with a line containing 0 0. Each field is given as one or more lines, each holding a pair of positive integers — the E–W and N–S coordinates of one well. A line -1 -1 marks the end of one field's data.
For each field, first print a header line OIL FIELD k, where k is the field number starting from 1.
If the map fits, draw it. Use @ for a well, * for a pipe, and . for an empty cell. A well takes precedence over a pipe, so print @ where a well and a pipe coincide. Draw a border around the mapped region: | for the N–S (vertical) edges and - for the E–W (horizontal) edges, but place + at every grid position that is a multiple of 5, including the corners. Label each + with its field coordinate. For an N–S + (a row), the label comes immediately before the + at the left edge, right-justified; the label of the northernmost row starts at the very first column of its line. For an E–W + (a column), the label is written on the line just below the bottom border, with its most significant digit directly under the +. Because of these labels, some map lines begin with leading spaces.
If the map does not fit, instead print one line: Map is too big to draw for pipeline at p, where p is the chosen N–S coordinate of the pipeline.