from math import gcd a, b, c, d = map(int, input().split()) if abs(gcd(a, b)) != abs(gcd(c, d)): print(-1) exit() def solve(x, y): ans = [] while x != 0 and y != 0: if abs(x) > abs(y): k = x // y ans.append((1, -k)) x -= k * y else: k = y // x ans.append((2, -k)) y -= k * x if y == 0: ans.append((2, 1)) ans.append((1, -1)) x, y = y, x if y < 0: ans.append((1, 1)) ans.append((2, -2)) ans.append((1, 1)) return ans A = solve(a, b) B = solve(c, d) rev = [(1, 1), (2, -2), (1, 1)] ans = A[:] for t, b_ in B[::-1]: ans.append((t, -b_)) print(len(ans)) for row in ans: print(*row) x, y = a, b for t, k in ans: if t == 1: x += y * k else: y += x * k assert (x, y) == (c, d), ((x, y), (c, d))