#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
int main() {
  int i, t;
  char ch[10];
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%s", ch);
    if (strlen(ch) == 5)
      printf("3\n");
    else if ((ch[0] == 'o' && ch[1] == 'n') || (ch[1] == 'n' && ch[2] == 'e') ||
             (ch[2] == 'e' && ch[0] == 'o'))
      printf("1\n");
    else
      printf("2\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     121c <main+0xec>
lea    -0x16(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x16(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    1199 <main+0x69>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
jmp    1209 <main+0xd9>
movsbl -0x16(%rbp),%eax
cmp    $0x6f,%eax
jne    11b3 <main+0x83>
movsbl -0x15(%rbp),%eax
cmp    $0x6e,%eax
je     11e7 <main+0xb7>
movsbl -0x15(%rbp),%eax
cmp    $0x6e,%eax
jne    11cd <main+0x9d>
movsbl -0x14(%rbp),%eax
cmp    $0x65,%eax
je     11e7 <main+0xb7>
movsbl -0x14(%rbp),%eax
cmp    $0x65,%eax
jne    11f8 <main+0xc8>
movsbl -0x16(%rbp),%eax
cmp    $0x6f,%eax
jne    11f8 <main+0xc8>
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
jmp    1204 <main+0xd4>
lea    0xe0d(%rip),%rdi
call   1040 <printf@plt>
jmp    1209 <main+0xd9>
jmp    120e <main+0xde>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    11e5 <main+0xb5>
lea    0xea0(%rip),%r14
lea    0xe(%rsp),%rbx
lea    0xe9b(%rip),%r15
lea    0xe92(%rip),%r12
lea    0xe89(%rip),%r13
xor    %ebp,%ebp
jmp    119e <main+0x6e>
xor    $0x65,%cl
xor    $0x6f,%al
or     %cl,%al
mov    %r13,%rdi
cmove  %r12,%rdi
nop
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jge    11e5 <main+0xb5>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
cmp    $0x5,%eax
je     1190 <main+0x60>
movzbl 0xe(%rsp),%eax
movzbl 0xf(%rsp),%edx
cmp    $0x6f,%al
jne    11d1 <main+0xa1>
mov    %r12,%rdi
cmp    $0x6e,%dl
je     1190 <main+0x60>
movzbl 0x10(%rsp),%ecx
cmp    $0x6e,%dl
jne    1181 <main+0x51>
mov    %r12,%rdi
cmp    $0x65,%cl
je     1190 <main+0x60>
jmp    1181 <main+0x51>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"3\0A\00"
@.str.3 = [3 x i8] c"1\0A\00"
@.str.4 = [3 x i8] c"2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i8]
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %2
br label %6
6: ; preds = %54, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %57
10: ; preds = %6
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = icmp eq i32 %14, 5
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %53
18: ; preds = %10
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 111
br i1 %22, label %23, label %28
23: ; preds = %18
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 110
br i1 %27, label %48, label %28
28: ; preds = %23, %18
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 110
br i1 %32, label %33, label %38
33: ; preds = %28
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 2
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 101
br i1 %37, label %48, label %38
38: ; preds = %33, %28
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 2
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 101
br i1 %42, label %43, label %50
43: ; preds = %38
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp eq i32 %46, 111
br i1 %47, label %48, label %50
48: ; preds = %43, %33, %23
%49 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %52
50: ; preds = %43, %38
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
br label %53
53: ; preds = %52, %16
br label %54
54: ; preds = %53
%55 = load i32, i32* %2
%56 = add nsw i32 %55, 1
store i32 %56, i32* %2
br label %6
57: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [2 x i8] c"2\00"
@str.5 = [2 x i8] c"1\00"
@str.6 = [2 x i8] c"3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %35, label %8
8: ; preds = %0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
br label %11
11: ; preds = %8, %29
%12 = phi i32 [ 1, %8 ], [ %32, %29 ]
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%14 = call i32 @strlen(i8* %4)
%15 = icmp eq i32 %14, 5
br i1 %15, label %29, label %16
16: ; preds = %11
%17 = load i8, i8* %4
%18 = icmp eq i8 %17, 111
%19 = load i8, i8* %9
%20 = icmp eq i8 %19, 110
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %29, label %22
22: ; preds = %16
%23 = load i8, i8* %10
%24 = icmp eq i8 %23, 101
%25 = select i1 %20, i1 %24, i1 false
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = select i1 %24, i1 %18, i1 false
%28 = select i1 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
br label %29
29: ; preds = %26, %16, %22, %11
%30 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), %22 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), %16 ], [ %28, %26 ]
%31 = call i32 @puts(i8* dereferenceable(1) %30)
%32 = add nuw nsw i32 %12, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %12, %33
br i1 %34, label %11, label %35
35: ; preds = %29, %0
ret i32 0
}