import sys input = sys.stdin.readline a,b,c,d=map(int,input().split()) if a==c and b==d: print(0) exit() if a==b==0 or c==d==0: print(-1) exit() X=[(a,b)] while a!=0 and b!=0: if abs(a)>abs(b): a=a%b X.append((a,b)) else: b=b%a X.append((a,b)) Y=[(c,d)] while c!=0 and d!=0: if abs(c)>abs(d): c=c%d Y.append((c,d)) else: d=d%c Y.append((c,d)) k=-1 for a in X[-1]: if a!=0: k=a l=-1 for a in Y[-1]: if a!=0: l=a if abs(k)!=abs(l): print(-1) exit() if X[-1]==Y[-1]: X=X+Y[::-1][1:] else: X[-1]=(k,k) X.append((k,l)) X.append((l,l)) X=X+Y[::-1][1:] ANS=[] for i in range(len(X)-1): a,b=X[i] c,d=X[i+1] if a==c: x=(d-b)//a ANS.append((2,x)) else: x=(c-a)//b ANS.append((1,x)) print(len(ANS)) for x,y in ANS: print(x,y)