#include <stdio.h>
#include <string.h>

int main(void) {
#   define fp stdin
#   define terminal_cmd "terminate\n"
#   define LINE_MAX sizeof terminal_cmd
/*  NOTE: The next source lines of code are taken from POSIX manpages:
    <http://p...content-available-to-author-only...p.org/onlinepubs/009696699/functions/fgets.html>    */
    char line[LINE_MAX];
	while (fgets(line, LINE_MAX, fp) != NULL) {
		printf("{%s}", line); // print the "line" of input with brackets
		if (!strcmp(line, terminal_cmd))
			return 0;
			
		int integer;
		if (sscanf(line, "%d", &integer) != 1)
			continue;
		
		printf("%d\n", integer * integer);
	}
	return 0;
}
