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

using namespace std ;

vector < int > List[28] ;

int N ;
int start ;
bool ans ;

int LineA[28] ;
int LineB[28] ;
char str[35] ;

int toNum ( char ) ;
void init ( ) ;
void BackTracking ( int , int ) ;

int main ( )
{
	while ( scanf ( "%d%*c" , &N ) == 1 && N ) {
		init ( ) ;
		for ( int i = 0 ; i < N ; i++ ) {
			gets ( str ) ;
			start = toNum ( *( str ) ) ;
			LineA[toNum ( *( str ) )]++ ;
			LineB[toNum ( *( str + strlen ( str ) - 1 ) )]++ ;
			List[toNum ( *( str ) )].push_back ( toNum ( *( str + strlen ( str ) - 1 ) ) ) ;
		}
		bool flag = true ;
		for ( int i = 0 ; i < 28 ; i++ ) {
			if ( LineA[i] != LineB[i] ) {
				flag = false ;
				break ;
			}
		}
		if ( flag == false ) {
			printf ( "NG\n" ) ;
		}
		else {
			BackTracking ( 0 , start ) ;
			if ( ans == true ) {
				printf ( "OK\n" ) ;
			}
			else {
				printf ( "NG\n" ) ;
			}
		}
	}
	return 0 ;
}

int toNum ( char c )
{
	if ( c >= 'a' && c <= 'z' ) {
		return c - 'a' ;
	}
	else {
		return -1 ;
	}
}

void init ( )
{
	for ( int i = 0 ; i < 28 ; i++ ) {
		List[i].clear ( ) ;
	}
	memset ( LineA , 0 , 28 * sizeof ( int ) ) ;
	memset ( LineB , 0 , 28 * sizeof ( int ) ) ;
	ans = false ;
}

void BackTracking ( int source , int now )
{
	if ( source == N ) {
		if ( now == start ) {
			ans = true ;
		}
		return ;
	}
	if ( ans == true ) {
		return ;
	}
	vector < int > :: iterator it = List[now].begin ( ) ;
	for (  ; it != List[now].end ( ) ; it++ ) {
		if ( LineB[*( it )] > 0 ) {
			LineB[*( it )]-- ;
			BackTracking ( source + 1 , *( it ) ) ;
			LineB[*( it )]++ ;
		}
	}
}