    #include <stdio.h>
    #include <ctype.h> /* for isdigit(c), etc. */
     
    #define MAX 10
    #define SIZE 15
     
    int getint(int *pn);
     
    int main(void){
    	int n, k;
    	int array[SIZE];
     
    	for(n = 0; n < SIZE && getint(&array[n]) != EOF; n++)
    		;
    	for(k = 0; k < n; k++)
    		printf("%d\n", array[k]);
    	scanf("%d", &k);
    }
     
    int getch(void);
    void ungetch(int c);
     
     
    int getint(int *pn)
{
	int c, sign;

	*pn = 0;
	while (isspace(c = getch()))
		;
	if (!isdigit(c) && c != EOF && c != '+' && c != '-') {
		/* ungetch(c);*/ /* if returned to input we fill the array */
		return 0;
	}
	sign = (c == '-') ? -1 : 1;
	if (c == '+' || c == '-') {
		c = getch();
		if (!isdigit(c)) {
			ungetch(sign == 1 ? '+' : '-');
			return 0;
		}
	}
	while (isdigit(c)) {
		*pn = 10 * *pn + (c - '0');
		c = getch();
	}
	*pn *= sign;
	if (c != EOF)
		ungetch(c);

	return c;
}
     
    int bufp = 0;
    int buf[MAX];
     
    int getch(void)
    {
    	return bufp > 0 ? buf[--bufp] : getchar();
    }
     
    void ungetch(int c)
    {
    	if (bufp < MAX)
    		buf[bufp++] = c;
    }