import sys input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 63 - 1 mod = 998244353 from math import gcd a, b, c, d = mi() if gcd(a, b) == 0: print(-1) exit() if gcd(c, d) % gcd(a, b): print(-1) exit() ans = [] x = a y = b for i in range(200): if x * y == 0: break 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 ans2 = [] x2 = c y2 = d for i in range(200): if x2 * y2 == 0: break if abs(x2) >= abs(y2): k = x2 // y2 x2 -= k * y2 ans2.append((1, k)) else: k = y2 // x2 y2 -= k * x2 ans2.append((2, k)) #入れ替え if x == 0 and x2 != 0: ans2.append((2, 1)) y2 += x2 ans2.append((1, -1)) x2 -= y2 if y == 0 and y2 != 0: ans2.append((1, 1)) x2 += y2 ans2.append((2, -1)) y2 += x2 #符号変え if x * x2 < 0: ans2.append((2, -1)) y2 -= x2 ans2.append((1, 1)) x2 += y2 ans2.append((1, 1)) x2 += y2 ans2.append((2, -1)) y2 += x2 if y * y2 < 0: ans2.append((1, -1)) x2 -= y2 ans2.append((2, 1)) y2 += x2 ans2.append((2, 1)) y2 += x2 ans2.append((1, -1)) x2 -= y2 ans = ans + ans2[::-1] x, y = a, b for t, k in ans: if t == 1: x += y * k else: y += x * k assert x == c and y == d print(len(ans)) for t, k in ans: print(t, k)