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

int main()
{
	char seq [ 1000 ];
	int len;

	if( scanf("%s", seq) != 1)
		{
			printf("Babi eisai mpoumpounas!\n");
				exit(1);
		}

	len = strlen(seq);

	if( seq[ 0 ] == 'A' &&
	    seq[ 1 ] == 'T' &&
	    seq[ 2 ] == 'G' &&
		seq[ len - 3 ] == 'T' &&
		seq[ len - 2 ] == 'A' &&
		seq[ len - 1 ] == 'A')
		{
			printf("ATG and TAA found!\n");
		}
	else
		{
			printf("ATG or TAA not found!\n");
		}


}

