/* Generated by re2c */
// re2c $INPUT -o $OUTPUT -i8 --input-encoding utf8
#include <assert.h>

int lex(const char *YYCURSOR)
{
#define YYCTYPE unsigned char
    const char *YYMARKER;

    
{
	YYCTYPE yych;
	yych = *YYCURSOR;
	switch (yych) {
		case '1': goto yy3;
		case '~': goto yy4;
		case 0xCE: goto yy5;
		case 0xD0: goto yy6;
		case 0xD1: goto yy7;
		case 0xEF: goto yy8;
		case 0xF0: goto yy9;
		default: goto yy1;
	}
yy1:
	++YYCURSOR;
yy2:
	{ return -1; }
yy3:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy10;
	goto yy2;
yy4:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy11;
	goto yy2;
yy5:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 0x88: goto yy12;
		default: goto yy2;
	}
yy6:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 0x90: goto yy14;
		case 0x9C: goto yy15;
		case 0xA1: goto yy16;
		case 0xA3: goto yy17;
		default: goto yy2;
	}
yy7:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 0x81: goto yy16;
		case 0xB7: goto yy18;
		default: goto yy2;
	}
yy8:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 0xBD: goto yy19;
		case 0xBE: goto yy20;
		default: goto yy2;
	}
yy9:
	yych = *(YYMARKER = ++YYCURSOR);
	switch (yych) {
		case 0x9D: goto yy21;
		case 0xA3: goto yy22;
		case 0xA4: goto yy23;
		case 0xA8: goto yy24;
		default: goto yy2;
	}
yy10:
	++YYCURSOR;
	{ return 4; }
yy11:
	++YYCURSOR;
	{ return 5; }
yy12:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy25;
yy13:
	YYCURSOR = YYMARKER;
	goto yy2;
yy14:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy26;
		default: goto yy13;
	}
yy15:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy27;
		default: goto yy13;
	}
yy16:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy28;
		default: goto yy13;
	}
yy17:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy29;
		default: goto yy13;
	}
yy18:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy30;
	goto yy13;
yy19:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB7: goto yy31;
		default: goto yy13;
	}
yy20:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x88: goto yy32;
		default: goto yy13;
	}
yy21:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x8C: goto yy33;
		default: goto yy13;
	}
yy22:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x9D: goto yy34;
		default: goto yy13;
	}
yy23:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB0: goto yy35;
		default: goto yy13;
	}
yy24:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xA2: goto yy36;
		default: goto yy13;
	}
yy25:
	++YYCURSOR;
	{ return 7; }
yy26:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xBD: goto yy37;
		default: goto yy13;
	}
yy27:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB0: goto yy38;
		default: goto yy13;
	}
yy28:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB5: goto yy39;
		default: goto yy13;
	}
yy29:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xBB: goto yy40;
		default: goto yy13;
	}
yy30:
	++YYCURSOR;
	{ return 6; }
yy31:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy41;
	goto yy13;
yy32:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy42;
	goto yy13;
yy33:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x92: goto yy43;
		default: goto yy13;
	}
yy34:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB7: goto yy44;
		default: goto yy13;
	}
yy35:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x96: goto yy45;
		default: goto yy13;
	}
yy36:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x88: goto yy46;
		default: goto yy13;
	}
yy37:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD1: goto yy47;
		default: goto yy13;
	}
yy38:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD1: goto yy48;
		default: goto yy13;
	}
yy39:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD1: goto yy49;
		default: goto yy13;
	}
yy40:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD1: goto yy50;
		default: goto yy13;
	}
yy41:
	++YYCURSOR;
	{ return 8; }
yy42:
	++YYCURSOR;
	{ return 9; }
yy43:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy51;
	goto yy13;
yy44:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy52;
	goto yy13;
yy45:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy53;
	goto yy13;
yy46:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy54;
	goto yy13;
yy47:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x8F: goto yy55;
		default: goto yy13;
	}
yy48:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x88: goto yy56;
		default: goto yy13;
	}
yy49:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x80: goto yy57;
		default: goto yy13;
	}
yy50:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x8F: goto yy58;
		default: goto yy13;
	}
yy51:
	++YYCURSOR;
	{ return 13; }
yy52:
	++YYCURSOR;
	{ return 10; }
yy53:
	++YYCURSOR;
	{ return 12; }
yy54:
	++YYCURSOR;
	{ return 11; }
yy55:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy59;
	goto yy13;
yy56:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy60;
		default: goto yy13;
	}
yy57:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy61;
		default: goto yy13;
	}
yy58:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy62;
	goto yy13;
yy59:
	++YYCURSOR;
	{ return 3; }
yy60:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB0: goto yy63;
		default: goto yy13;
	}
yy61:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB3: goto yy64;
		default: goto yy13;
	}
yy62:
	++YYCURSOR;
	{ return 2; }
yy63:
	yych = *++YYCURSOR;
	if (yych <= 0x00) goto yy65;
	goto yy13;
yy64:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy66;
		default: goto yy13;
	}
yy65:
	++YYCURSOR;
	{ return 1; }
yy66:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xB5: goto yy67;
		default: goto yy13;
	}
yy67:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0xD0: goto yy68;
		case 0xD1: goto yy69;
		default: goto yy13;
	}
yy68:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x90:
		case 0x91:
		case 0x92:
		case 0x93:
		case 0x94:
		case 0x95:
		case 0x96:
		case 0x97:
		case 0x98:
		case 0x99:
		case 0x9A:
		case 0x9B:
		case 0x9C:
		case 0x9D:
		case 0x9E:
		case 0x9F:
		case 0xA0:
		case 0xA1:
		case 0xA2:
		case 0xA3:
		case 0xA4:
		case 0xA5:
		case 0xA6:
		case 0xA7:
		case 0xA8:
		case 0xA9:
		case 0xAA:
		case 0xAB:
		case 0xAC:
		case 0xAD:
		case 0xAE:
		case 0xAF:
		case 0xB0:
		case 0xB1:
		case 0xB2:
		case 0xB3:
		case 0xB4:
		case 0xB5:
		case 0xB6:
		case 0xB7:
		case 0xB8:
		case 0xB9:
		case 0xBA:
		case 0xBB:
		case 0xBC:
		case 0xBD:
		case 0xBE:
		case 0xBF: goto yy70;
		default: goto yy13;
	}
yy69:
	yych = *++YYCURSOR;
	switch (yych) {
		case 0x80:
		case 0x81:
		case 0x82:
		case 0x83:
		case 0x84:
		case 0x85:
		case 0x86:
		case 0x87:
		case 0x88:
		case 0x89:
		case 0x8A:
		case 0x8B:
		case 0x8C:
		case 0x8D:
		case 0x8E:
		case 0x8F: goto yy70;
		default: goto yy13;
	}
yy70:
	yych = *++YYCURSOR;
	if (yych >= 0x01) goto yy13;
	++YYCURSOR;
	{ return 0; }
}

}

#define TEST(s, i) assert(lex(s) == i)

int main()
{
    TEST("Аня", 3);
    TEST("Маша", 1);
    TEST("Уля", 2);
    TEST("1", 4);
    TEST("~", 5);
    TEST("ѷ", 6);
    TEST("Έ", 7);
    TEST("ｷ", 8);
    TEST("ﾈ", 9);
    TEST("𣝷", 10);
    TEST("𨢈", 11);
    TEST("𤰖", 12);
    TEST("𝌒", 13);
    TEST("Сергей", 0);
    TEST("Сергеы", 0);
    TEST("сергеЫ", 0);
    return 0;
}
