/*   @JUDGE_ID:   1705PZ   333   C */
#include <stdio.h>
#include <string.h>

int main()
{
	int i,count,dcount,flag;
	int num[10];
	char string[128],isbn[128];

	while(scanf("%s",string) == 1)
	{
		flag = 0; count = 0;

		for(i = 0;string[i];i++)
			if(strchr("0123456789X-",string[i]))
				isbn[count++] = string[i];

		/* the first and the last char shouldn't be '-' */
		if(isbn[0] == '-' || isbn[count - 1] == '-')
			flag = 1;

		/* '-' '-' */
		for(i = 1;i < count - 2;i++)
			if(isbn[i] == '-' && isbn[i + 1] == '-')
				flag = 1;

		/* it must contain 10 digit */
		dcount = 0;
		for(i = 0;i < count;i++)
			if(strchr("0123456789X",isbn[i]))
				dcount++;
		if(dcount != 10)
			flag = 1;

		/* 'X' shouldn't appear in the first nine char */
		for(i = 0;i < count - 1;i++)
			if(isbn[i] == 'X')
				flag = 1;

		/* convert char to int and 'X' to 10 */
		dcount = 0;
		for(i = 0;i < count;i++)
			if(strchr("0123456789",isbn[i]))
				num[dcount++] = isbn[i] - '0';
		if(isbn[count - 1] == 'X')
			num[dcount] = 10;

		/* calculate */
		for(i = 1;i < 10;i++)
			num[i] += num[i - 1];
		for(i = 1;i < 10;i++)
			num[i] += num[i - 1];

		/* print answer */
		if(flag || num[9] % 11 != 0)
			printf("%s is incorrect.\n",string);
		else
			printf("%s is correct.\n",string);
	}
	return 0;
}
@END_OF_SOURCE_CODE
