// Author: Ivan Kazmenko (gassa@mail.ru)
#define PROBLEM_VERSION_DIV1 1
#define PROBLEM_VERSION_DIV2 2
#define PROBLEM_VERSION PROBLEM_VERSION_DIV1
#include <set>
#include <string>
#include "testlib.h"

using namespace std;

int const MIN_N   =       1;
int const MAX_N   =  100000;
int const MAX_LEN = 3000000;
#if PROBLEM_VERSION == PROBLEM_VERSION_DIV1
int const LET = 26;
char const WORD_PATTERN [] = "[a-z]{1,3000000}";
#else
int const LET = 10;
char const WORD_PATTERN [] = "[a-j]{1,3000000}";
#endif

int n;

struct coord
{
	int x, y;
	coord (int nx, int ny): x (nx), y (ny) {}
	bool operator < (coord const & other) const
	{
		if (x != other.x)
		{
			return x < other.x;
		}
		return y < other.y;
	}
};

int main (void)
{
	setName ("validator for problem \"forbidden-words\"");

	registerValidation ();

	n = inf.readInt (MIN_N, MAX_N);
	inf.readEoln ();

	set <string> s;
	int len = 0;
	for (int i = 0; i < n; i++)
	{
		string t = inf.readLine (WORD_PATTERN);
		len += t.length ();
		ensure (len <= MAX_LEN);
		ensure (s.find (t) == s.end ());
		s.insert (t);
	} 

	inf.readEof ();

	return 0;
}
