/**********************************

 **    File:       series.c      **

 **    Programmer: Marc Douet    **

 **    Date:       10/11/03      **

 **********************************/

#include <stdio.h>
#include <stdlib.h>
#include "math.h"

#define  TRUE		 1
#define  FALSE		 0
#define  MIN_VALUE	-1000
#define  MAX_VALUE	 1000


/**********************

 ** Global Variables **

 **********************/
int		Val1, 
		Val2,
		Val3;


/* 

 * Function:     int inputValidated(void)

 *

 * Description:  Verify that the input meets the constraints outlined

 *               in the problem specification.

 */
int inputValidated()
{
	if(Val1 < MIN_VALUE || Val1 > MAX_VALUE ||
	   Val2 < MIN_VALUE || Val2 > MAX_VALUE ||
	   Val3 < MIN_VALUE || Val3 > MAX_VALUE) {
		return FALSE;
	} else {
		return TRUE;
	}
}


/* 

 * Function:     void solvePoly(void)

 *

 * Description:  Solve for and print f(3), f(4), f(5) given f(0), f(1), f(2).

 */
void solvePoly()
{
	int A,B,C, index;

	/* C = f(0) */
	C = Val1;

	/* A = ([f(2) - 2f(1) + f(0)] / 2) */
	A = ((Val3 - (2*Val2) + Val1) / 2);

	/* B = f(1) - A - C */
	B = (Val2 - A - C);

	/* Determine the results of f(3), f(4), and f(5) based on the values of A,B,C. */
	for(index = 3; index <= 5; index++) {
		int result = ((A * (int)pow(index, 2)) + (B * index) + C);
		printf("%i", result);

                /* Only print a space after the first and second output.*/
		if(index != 5) {
			printf(" ");
		}
	}

	printf("\n");
}


/* 

 * Function:     int main(void)

 *

 * Description:  Main driver responsible for reading in data and printing

 *               the appripriate output response.

 */
int main()
{
	/* Read in f(0), f(1), and f(2) until there is not more input to process. */
	while(scanf("%i %i %i", &Val1, &Val2, &Val3) == 3) {   
		/* Ensure the read in values are valid. */
		if(!inputValidated()) {
			printf("Error: The input did was not in the range of (%i)->(%i)!\n",
			        MIN_VALUE, MAX_VALUE);
			return 1;
		}

		/* Print the values of f(3), f(4), and f(5). */
		solvePoly();
	}

  return 0;
}