Little Petya loves playing with rectangles. Mom bought Petya a rectangle divided into cells *n* × *m* in size (containing *n* rows, *m* columns). Petya marked two different cells of the rectangle and now he is solving the following task:

Let's define a simple path between those two cells as a sequence of distinct cells *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*k*</sub>, where *a*<sub class="lower-index">1</sub> and *a*<sub class="lower-index">*k*</sub> are the two marked cells. Besides, *a*<sub class="lower-index">*i*</sub> and *a*<sub class="lower-index">*i* + 1</sub> are side-neighboring cells of the path (1 ≤ *i* &lt; *k*). Let's denote the path length as number *k* (the sequence length). 

Petya's task is to find the longest simple path's length and to print the path. Help him.
The first line contains space-separated integers *n* and *m* (4 ≤ *n*, *m* ≤ 1000) — the number of rows and the number of columns in the rectangle, correspondingly. The second line contains space-separated integers *x*<sub class="lower-index">1</sub> and *y*<sub class="lower-index">1</sub> — the coordinates of the first marked cell. The third line contains space-separated integers *x*<sub class="lower-index">2</sub> *y*<sub class="lower-index">2</sub> — the coordinates of the second marked cell (1 &lt; *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub> &lt; *n*, 1 &lt; *y*<sub class="lower-index">1</sub>, *y*<sub class="lower-index">2</sub> &lt; *m*, *x*<sub class="lower-index">1</sub> ≠ *x*<sub class="lower-index">2</sub>, *y*<sub class="lower-index">1</sub> ≠ *y*<sub class="lower-index">2</sub>).

The coordinates of a marked cell are a pair of integers *x* *y*, where *x* represents the row's number and *y* represents the column's number. The rows are numbered from top to bottom with consecutive integers from 1 to *n*. The columns are numbered from the left to the right by consecutive integers from 1 to *m*.

It is guaranteed that the marked cells are not positioned in one row or column.
from sys import stdin, stdout
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]

n, m = map(int, stdin.readline().split())
x1, y1 = map(int, stdin.readline().split())
x2, y2 = map(int, stdin.readline().split())
x1 -= 1
y1 -= 1
x2 -= 1
y2 -= 1

dist = [[-1]*m for _ in range(n)]
dist[x1][y1] = 0
q = [(x1, y1)]
for x, y in q:
    for dir in range(4):
        nx, ny = x+dx[dir], y+dy[dir]
        if nx >= 0 and ny >= 0 and nx < n and ny < m and dist[nx][ny] == -1:
            dist[nx][ny] = dist[x][y]+1
            q.append((nx, ny))

ans = dist[x2][y2]
stdout.write(str(ans)+'\n')
x, y = x2, y2
while ans:
    stdout.write(str(x+1)+' '+str(y+1)+'\n')
    for dir in range(4):
        nx, ny = x+dx[dir], y+dy[dir]
        if nx >= 0 and ny >= 0 and nx < n and ny < m and dist[nx][ny] == ans-1:
            x, y = nx, ny
            ans -= 1
            break
stdout.write(str(x1+1)+' '+str(y1+1)+'\n')