x = [0] y = [1] for i in range(50): nx = 2 * x[-1] + y[-1] ny = 3 * x[-1] + 2 * y[-1] x.append(nx) y.append(ny) v, w = 0, 0 for i in range(51): if x[i] < 5 * 10 ** 8 and y[i] < 10 ** 9: v, w = x[i], y[i] print(0, 0) print(0, 2 * v) print(w, v) #print(4 * v * v) #print(w * w + v * v)