// Arup Guha
// 11/11/2017
// Solution to 2017 SER D2 Problem: Arithmetic Sequences

import java.util.*;

public class sequences {

	public static void main(String[] args) {

		// Read in the data - store current expectation.
		Scanner stdin = new Scanner(System.in);
		int[] terms = new int[10];

		// Read in the terms - store non-zero terms.
		int x = -1, y = -1;
		for (int i=0; i<10; i++) {
			terms[i] = stdin.nextInt();
			if (terms[i] != 0 && x < 0) x = i;
			if (terms[i] != 0 && x >= 0) y = i;
		}

		// Can't make a sequence with integers.
		if ((terms[y] - terms[x])%(y - x) != 0)
			System.out.println(-1);

		// Build the sequence.
		else {

			// Get the difference and use it to fill in the sequence.
			int diff = (terms[y] - terms[x])/(y-x);
			for (int i = 0; i<10; i++)
				terms[i] = terms[y] + diff*(i-y);

			// Print out the terms.
			for (int i=0; i<9; i++)
				System.out.print(terms[i]+" ");
			System.out.println(terms[9]);
		}
	}
}