There are four stones on an infinite line in integer coordinates a_1, a_2, a_3, a_4. The goal is to have the stones in coordinates b_1, b_2, b_3, b_4. The order of the stones does not matter, that is, a stone from any position a_i can end up in at any position b_j, provided there is a required number of stones in each position (that is, if a coordinate x appears k times among numbers b_1, …, b_4, there should be exactly k stones at x in the end).

We are allowed to move stones with the following operation: choose two stones at distinct positions x and y with at least one stone each, and move one stone from x to 2y - x. In other words, the operation moves a stone to a symmetric position relative to some other stone. At any moment it is allowed to have any number of stones at the same position.

Find any sequence of operations that achieves the goal, or determine that it is impossible. The sequence does not have to be shortest, but it may contain at most 1000 operations.

Input

The first line contains four integers a_1, …, a_4 (-10^9 ≤ a_i ≤ 10^9) — initial coordinates of the stones. There may be multiple stones sharing the same coordinate.

The second line contains four integers b_1, …, b_4 (-10^9 ≤ b_i ≤ 10^9) — target coordinates of the stones. There may be multiple targets sharing the same coordinate.

Output

If there is no sequence of operations that achieves the goal, print a single integer -1. Otherwise, on the first line print a single integer k (0 ≤ k ≤ 1000) — the number of operations in your sequence. On the next k lines, describe the operations. The i-th of these lines should contain two integers x_i and y_i (x_i ≠ y_i) — coordinates of the moved stone and the center of symmetry stone for the i-th operation.

For each operation i, there should at least one stone in each of the coordinates x_i and y_i, and the resulting coordinate 2y_i - x_i must not exceed 10^{18} by absolute value.

If there are multiple suitable sequences, print any of them. It is guaranteed that if there is a suitable sequence of operations, then there is also a suitable sequence that satisfies all the additional requirement.

Examples

Input


0 1 2 3
3 5 6 8


Output


3
1 3
2 5
0 3


Input


0 0 0 0
1 1 1 1


Output


-1


Input


0 0 0 1
0 1 0 1


Output


-1

Difficulty: VERY_HARD
Tags: Constructive algorithms

Starter code:

Solutions:
def gcd(a, b):
	while a and b:
		a %= b
		if a:
			b %= a
	return a + b

def gcd2(A):
	r = A[1] - A[0]
	for i in (2, 3):
		r = gcd(r, A[i] - A[0])
	return r

def Mir(x, c):
	return c * 2 - x

def Solve(A):
	A[0].sort()
	A[1].sort()
	gcds = [gcd2(A[0]), gcd2(A[1])]
	(I0, I1) = (0, 1)
	if A[0][-1] - A[0][0] > A[1][-1] - A[1][0]:
		(I0, I1) = (I1, I0)
	if A[I1][-1] == A[I1][0]:
		if A[I1][0] == A[I0][0]:
			return []
		return None
	elif A[I0][-1] == A[I0][0]:
		return None
	if gcds[0] != gcds[1]:
		return None
	if (A[0][0] - A[1][0]) % gcds[0] != 0:
		return None
	ops = [[], []]

	def Op(I, J1, JC):
		ops[I].append((A[I0][J1], A[I0][JC]))
		A[I0][J1] = Mir(A[I0][J1], A[I0][JC])
	while True:
		for a in A:
			a.sort()
		if max(A[0][-1], A[1][-1]) - min(A[0][0], A[1][0]) <= gcds[0]:
			break
		gapL = abs(A[0][0] - A[1][0])
		gapR = abs(A[0][-1] - A[1][-1])
		if gapL > gapR:
			(I0, I1) = (0, 1) if A[0][0] < A[1][0] else (1, 0)
			view = lambda x: x
		else:
			(I0, I1) = (0, 1) if A[0][-1] > A[1][-1] else (1, 0)
			view = lambda x: 3 - x
		for a in A:
			a.sort(key=view)
		lim = max(view(A[I0][-1]), view(A[I1][-1]))
		B = [view(x) for x in A[I0]]
		actioned = False
		for J in (3, 2):
			if Mir(B[0], B[J]) <= lim:
				Op(I0, 0, J)
				actioned = True
				break
		if actioned:
			continue
		if Mir(B[0], B[1]) > lim:
			Op(I0, 3, 1)
			continue
		if (B[1] - B[0]) * 8 >= lim - B[0]:
			Op(I0, 0, 1)
			continue
		if (B[3] - B[2]) * 8 >= lim - B[0]:
			Op(I0, 0, 2)
			Op(I0, 0, 3)
			continue
		if B[1] - B[0] < B[3] - B[2]:
			Op(I0, 1, 2)
			Op(I0, 1, 3)
		else:
			Op(I0, 2, 1)
			Op(I0, 2, 0)
		Op(I0, 0, 1)
	if A[0] != A[1]:
		return None
	return ops[0] + [(Mir(x, c), c) for (x, c) in reversed(ops[1])]

def Output(ops):
	if ops is None:
		print(-1)
		return
	print(len(ops))
	for (x, c) in ops:
		print(x, c)
import sys
A = [list(map(int, sys.stdin.readline().split())) for _ in range(2)]
Output(Solve(A))