#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 scanf(char *, int *, ...);
int main() {
  int n, ox, oy, x, y;
  while (scanf("%i", &n), n) {
    scanf("%i %i", &ox, &oy);
    while (n--) {
      scanf("%i %i", &x, &y);
      if (x == ox || y == oy)
        printf("divisa\n");
      else {
        printf("%s%s\n", y > oy ? "N" : "S", x > ox ? "E" : "O");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1202 <main+0xe2>
lea    0xeae(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
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     11fd <main+0xdd>
lea    0xe84(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11a3 <main+0x83>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11b6 <main+0x96>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f8 <main+0xd8>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%edx
lea    0xe53(%rip),%rsi
lea    0xe4a(%rip),%rax
cmp    %edx,%ecx
cmovg  %rax,%rsi
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edi
lea    0xe3d(%rip),%rdx
lea    0xe34(%rip),%rax
cmp    %edi,%ecx
cmovg  %rax,%rdx
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1161 <main+0x41>
jmp    112f <main+0xf>
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    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     121f <main+0xef>
lea    0xe9d(%rip),%rbx
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r14
lea    0xea0(%rip),%r15
lea    0xe95(%rip),%r13
lea    0xe84(%rip),%r12
jmp    11aa <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe6c(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     121f <main+0xef>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
jmp    11c8 <main+0x98>
mov    %r15,%rdi
call   1030 <puts@plt>
subl   $0x1,0x4(%rsp)
jb     1190 <main+0x60>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x14(%rsp),%ecx
cmp    %ecx,%eax
je     11c0 <main+0x90>
mov    0x10(%rsp),%edx
cmp    %edx,0x8(%rsp)
je     11c0 <main+0x90>
lea    0xe10(%rip),%rsi
jg     1205 <main+0xd5>
lea    0xe09(%rip),%rsi
mov    %r13,%rdx
cmp    %ecx,%eax
jg     1213 <main+0xe3>
lea    0xdff(%rip),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11c8 <main+0x98>
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"%i\00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [8 x i8] c"divisa\0A\00"
@.str.3 = [6 x i8] c"%s%s\0A\00"
@.str.4 = [2 x i8] c"N\00"
@.str.5 = [2 x i8] c"S\00"
@.str.6 = [2 x i8] c"E\00"
@.str.7 = [2 x i8] c"O\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
br label %7
7: ; preds = %41, %0
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %42
11: ; preds = %7
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
br label %13
13: ; preds = %40, %11
%14 = load i32, i32* %2
%15 = add nsw i32 %14, -1
store i32 %15, i32* %2
%16 = icmp ne i32 %14, 0
br i1 %16, label %17, label %41
17: ; preds = %13
%18 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%19 = load i32, i32* %5
%20 = load i32, i32* %3
%21 = icmp eq i32 %19, %20
br i1 %21, label %26, label %22
22: ; preds = %17
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22, %17
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %40
28: ; preds = %22
%29 = load i32, i32* %6
%30 = load i32, i32* %4
%31 = icmp sgt i32 %29, %30
%32 = zext i1 %31 to i64
%33 = select i1 %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%34 = load i32, i32* %5
%35 = load i32, i32* %3
%36 = icmp sgt i32 %34, %35
%37 = zext i1 %36 to i64
%38 = select i1 %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %33, i8* %38)
br label %40
40: ; preds = %28, %26
br label %13
41: ; preds = %13
br label %7
42: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.3 = [6 x i8] c"%s%s\0A\00"
@.str.4 = [2 x i8] c"N\00"
@.str.5 = [2 x i8] c"S\00"
@.str.6 = [2 x i8] c"E\00"
@.str.7 = [2 x i8] c"O\00"
@str = [7 x i8] c"divisa\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 0
br i1 %13, label %44, label %18
14: ; preds = %40, %18
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 0
br i1 %17, label %44, label %18
18: ; preds = %0, %14
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
store i32 %21, i32* %1
%22 = icmp eq i32 %20, 0
br i1 %22, label %14, label %23
23: ; preds = %18, %40
%24 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = icmp eq i32 %25, %26
br i1 %27, label %32, label %28
28: ; preds = %23
%29 = load i32, i32* %5
%30 = load i32, i32* %3
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28, %23
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %40
34: ; preds = %28
%35 = icmp sgt i32 %29, %30
%36 = select i1 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0)
%37 = icmp sgt i32 %25, %26
%38 = select i1 %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %36, i8* %38)
br label %40
40: ; preds = %34, %32
%41 = load i32, i32* %1
%42 = add nsw i32 %41, -1
store i32 %42, i32* %1
%43 = icmp eq i32 %41, 0
br i1 %43, label %14, label %23
44: ; preds = %14, %0
ret i32 0
}