#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t;
  char c[6];
  scanf("%d", &t);
  while (t > 0, t--) {
    scanf("%s", &c);
    if (c[3] != '\0')
      puts("3");
    else if (c[0] == 'o' && (c[1] == 'n' || c[2] == 'e') ||
             c[1] == 'n' && c[2] == 'e')
      puts("1");
    else if (c[0] == 't' && (c[1] == 'w' || c[2] == 'o') ||
             c[1] == 'w' && c[2] == 'o')
      puts("2");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1233 <main+0x113>
lea    0xea7(%rip),%rdi
lea    -0xe(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0xb(%rbp),%eax
cmp    $0x0,%eax
je     1185 <main+0x65>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
jmp    122e <main+0x10e>
movsbl -0xe(%rbp),%eax
cmp    $0x6f,%eax
jne    11ac <main+0x8c>
movsbl -0xd(%rbp),%eax
cmp    $0x6e,%eax
je     11c6 <main+0xa6>
movsbl -0xc(%rbp),%eax
cmp    $0x65,%eax
je     11c6 <main+0xa6>
movsbl -0xd(%rbp),%eax
cmp    $0x6e,%eax
jne    11d7 <main+0xb7>
movsbl -0xc(%rbp),%eax
cmp    $0x65,%eax
jne    11d7 <main+0xb7>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
jmp    1229 <main+0x109>
movsbl -0xe(%rbp),%eax
cmp    $0x74,%eax
jne    11fe <main+0xde>
movsbl -0xd(%rbp),%eax
cmp    $0x77,%eax
je     1218 <main+0xf8>
movsbl -0xc(%rbp),%eax
cmp    $0x6f,%eax
je     1218 <main+0xf8>
movsbl -0xd(%rbp),%eax
cmp    $0x77,%eax
jne    1224 <main+0x104>
movsbl -0xc(%rbp),%eax
cmp    $0x6f,%eax
jne    1224 <main+0x104>
lea    0xdeb(%rip),%rdi
call   1030 <puts@plt>
jmp    1229 <main+0x109>
jmp    122e <main+0x10e>
jmp    1141 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1157 <main+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xea5(%rip),%r14
lea    0x6(%rsp),%r15
lea    0xe9c(%rip),%rbx
lea    0xe97(%rip),%r12
lea    0xe92(%rip),%r13
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x0,0x9(%rsp)
mov    %rbx,%rdi
je     11b0 <main+0x90>
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jae    1180 <main+0x60>
jmp    1147 <main+0x27>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x6(%rsp),%edx
movzbl 0x7(%rsp),%ecx
movzbl 0x8(%rsp),%eax
cmp    $0x6f,%dl
jne    11d5 <main+0xb5>
mov    %r12,%rdi
cmp    $0x6e,%cl
je     1197 <main+0x77>
mov    %r12,%rdi
cmp    $0x65,%al
jne    11f0 <main+0xd0>
jmp    1197 <main+0x77>
cmp    $0x6e,%cl
jne    11e1 <main+0xc1>
mov    %r12,%rdi
cmp    $0x65,%al
je     1197 <main+0x77>
cmp    $0x74,%dl
jne    11f0 <main+0xd0>
mov    %r13,%rdi
cmp    $0x77,%cl
jne    11f5 <main+0xd5>
jmp    1197 <main+0x77>
cmp    $0x77,%cl
jne    119c <main+0x7c>
mov    %r13,%rdi
cmp    $0x6f,%al
je     1197 <main+0x77>
jmp    119c <main+0x7c>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [2 x i8] c"2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %76, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %77
12: ; preds = %5
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [6 x i8]* %3)
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %76
20: ; preds = %12
%21 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 111
br i1 %24, label %25, label %35
25: ; preds = %20
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 110
br i1 %29, label %45, label %30
30: ; preds = %25
%31 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 101
br i1 %34, label %45, label %35
35: ; preds = %30, %20
%36 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 110
br i1 %39, label %40, label %47
40: ; preds = %35
%41 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 101
br i1 %44, label %45, label %47
45: ; preds = %40, %30, %25
%46 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %75
47: ; preds = %40, %35
%48 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 116
br i1 %51, label %52, label %62
52: ; preds = %47
%53 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 119
br i1 %56, label %72, label %57
57: ; preds = %52
%58 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 111
br i1 %61, label %72, label %62
62: ; preds = %57, %47
%63 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 119
br i1 %66, label %67, label %74
67: ; preds = %62
%68 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 111
br i1 %71, label %72, label %74
72: ; preds = %67, %57, %52
%73 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %74
74: ; preds = %72, %67, %62
br label %75
75: ; preds = %74, %45
br label %76
76: ; preds = %75, %18
br label %5
77: ; preds = %5
%78 = load i32, i32* %1
ret i32 %78
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"3\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [2 x i8] c"2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [6 x i8], [6 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 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %45, label %9
9: ; preds = %0
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 1
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
br label %13
13: ; preds = %9, %41
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [6 x i8]* %2)
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %38
17: ; preds = %13
%18 = load i8, i8* %4
%19 = icmp eq i8 %18, 111
%20 = load i8, i8* %11
%21 = icmp eq i8 %20, 110
%22 = load i8, i8* %12
%23 = icmp eq i8 %22, 101
br i1 %19, label %24, label %26
24: ; preds = %17
%25 = select i1 %21, i1 true, i1 %23
br i1 %25, label %38, label %34
26: ; preds = %17
%27 = select i1 %21, i1 %23, i1 false
br i1 %27, label %38, label %28
28: ; preds = %26
%29 = icmp eq i8 %18, 116
br i1 %29, label %30, label %34
30: ; preds = %28
%31 = icmp eq i8 %20, 119
%32 = icmp eq i8 %22, 111
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %38, label %41
34: ; preds = %24, %28
%35 = icmp eq i8 %20, 119
%36 = icmp eq i8 %22, 111
%37 = select i1 %35, i1 %36, i1 false
br i1 %37, label %38, label %41
38: ; preds = %30, %34, %24, %26, %13
%39 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %13 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %26 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %24 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %34 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), %30 ]
%40 = call i32 @puts(i8* dereferenceable(1) %39)
br label %41
41: ; preds = %38, %30, %34
%42 = load i32, i32* %1
%43 = add nsw i32 %42, -1
store i32 %43, i32* %1
%44 = icmp eq i32 %42, 0
br i1 %44, label %45, label %13
45: ; preds = %41, %0
ret i32 0
}