#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 T, len, i, f;
  char s[10001];
  scanf("%d", &T);
  while (T--) {
    scanf("%s", s);
    f = 0;
    len = strlen(s);
    for (i = 0; i < len / 2; i++) {
      if (s[i] != s[len - i - 1]) {
        f = 1;
        break;
      }
    }
    if (f)
      printf("losses\n");
    else
      printf("wins\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2740,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1231 <main+0x101>
lea    -0x2730(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x2730(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2734(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2734(%rbp),%eax
cmp    %ecx,%eax
jge    1205 <main+0xd5>
movslq -0x10(%rbp),%rax
movsbl -0x2730(%rbp,%rax,1),%eax
ff
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x2730(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     11f2 <main+0xc2>
movl   $0x1,-0x14(%rbp)
jmp    1205 <main+0xd5>
jmp    11f7 <main+0xc7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119a <main+0x6a>
cmpl   $0x0,-0x14(%rbp)
je     1220 <main+0xf0>
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
jmp    122c <main+0xfc>
lea    0xde7(%rip),%rdi
call   1040 <printf@plt>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x2740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2730,%rsp
lea    0xeb9(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    116d <main+0x3d>
xor    %eax,%eax
add    $0x2730,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe8f(%rip),%r14
lea    0x10(%rsp),%r13
lea    0xe86(%rip),%r15
lea    0xe84(%rip),%r12
jmp    119f <main+0x6f>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     115a <main+0x2a>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
cmp    $0x2,%eax
jl     1193 <main+0x63>
mov    %eax,%ecx
shr    %ecx
add    $0xffffffff,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0x10(%rsp,%rdx,1),%ebx
movslq %eax,%rsi
cmp    0x10(%rsp,%rsi,1),%bl
jne    1190 <main+0x60>
add    $0x1,%rdx
add    $0xffffffff,%eax
cmp    %rdx,%rcx
jne    11d0 <main+0xa0>
mov    %r15,%rdi
jmp    1193 <main+0x63>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"losses\0A\00"
@.str.3 = [6 x i8] c"wins\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10001 x i8]
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %49, %0
%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 %50
12: ; preds = %8
%13 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
store i32 0, i32* %5
%15 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %3
store i32 0, i32* %4
br label %17
17: ; preds = %39, %12
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 2
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %42
22: ; preds = %17
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = sub nsw i32 %28, %29
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %27, %35
br i1 %36, label %37, label %38
37: ; preds = %22
store i32 1, i32* %5
br label %42
38: ; preds = %22
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %17
42: ; preds = %37, %17
%43 = load i32, i32* %5
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %49
47: ; preds = %42
%48 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %8
50: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [5 x i8] c"wins\00"
@str.4 = [7 x i8] c"losses\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10001 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [10001 x i8], [10001 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 %36, label %9
9: ; preds = %0, %30
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i32 @strlen(i8* %4)
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = lshr i32 %11, 1
%15 = zext i32 %14 to i64
br label %18
16: ; preds = %18
%17 = icmp eq i64 %29, %15
br i1 %17, label %30, label %18
18: ; preds = %13, %16
%19 = phi i64 [ 0, %13 ], [ %29, %16 ]
%20 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = trunc i64 %19 to i32
%23 = xor i32 %22, -1
%24 = add i32 %11, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10001 x i8], [10001 x i8]* %2, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = icmp eq i8 %21, %27
%29 = add nuw nsw i64 %19, 1
br i1 %28, label %16, label %30
30: ; preds = %16, %18, %9
%31 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0), %16 ]
%32 = call i32 @puts(i8* dereferenceable(1) %31)
%33 = load i32, i32* %1
%34 = add nsw i32 %33, -1
store i32 %34, i32* %1
%35 = icmp eq i32 %33, 0
br i1 %35, label %36, label %9
36: ; preds = %30, %0
ret i32 0
}