from math import gcd a, b, c, d = map(int, input().split()) if gcd(a, b) != 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)) 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) 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)