#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 *, ...);
int main() {
  int lightX;
  int lightY;
  int thorX;
  int thorY;
  scanf("%d%d%d%d", &lightX, &lightY, &thorX, &thorY);
  while (42) {
    int remainingTurns;
    scanf("%d", &remainingTurns);
    if (thorY > lightY) {
      printf("N");
      thorY--;
    } else if (thorY < lightY) {
      printf("S");
      thorY++;
    }
    if (thorX > lightX) {
      printf("W");
      thorX--;
    } else if (thorX < lightX) {
      printf("E");
      thorX++;
    }
    printf("\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1185 <main+0x65>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x8b>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a6 <main+0x86>
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ab <main+0x8b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d1 <main+0xb1>
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    11f7 <main+0xd7>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f2 <main+0xd2>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11f7 <main+0xd7>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x2d>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb6(%rip),%r14
lea    0x14(%rsp),%rbx
jmp    1179 <main+0x59>
nopw   0x0(%rax,%rax,1)
mov    $0x57,%edi
call   1030 <putchar@plt>
addl   $0xffffffff,0x8(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x4(%rsp)
jle    11b0 <main+0x90>
mov    $0x4e,%edi
call   1030 <putchar@plt>
addl   $0xffffffff,0x4(%rsp)
jmp    11c1 <main+0xa1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jge    11c1 <main+0xa1>
mov    $0x53,%edi
call   1030 <putchar@plt>
addl   $0x1,0x4(%rsp)
mov    0x10(%rsp),%eax
cmp    %eax,0x8(%rsp)
jg     1160 <main+0x40>
jge    116f <main+0x4f>
mov    $0x45,%edi
call   1030 <putchar@plt>
addl   $0x1,0x8(%rsp)
jmp    116f <main+0x4f>

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"N\00"
@.str.3 = [2 x i8] c"S\00"
@.str.4 = [2 x i8] c"W\00"
@.str.5 = [2 x i8] c"E\00"
@.str.6 = [2 x i8] c"\0A\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
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
br label %8
8: ; preds = %0, %43
%9 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
br label %26
17: ; preds = %8
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %21, %17
br label %26
26: ; preds = %25, %13
%27 = load i32, i32* %4
%28 = load i32, i32* %2
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -1
store i32 %33, i32* %4
br label %43
34: ; preds = %26
%35 = load i32, i32* %4
%36 = load i32, i32* %2
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %42
42: ; preds = %38, %34
br label %43
43: ; preds = %42, %30
%44 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %8
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [3 x i8] c"%d\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 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%11 = bitcast i32* %5 to i8*
br label %12
12: ; preds = %41, %0
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = call i32 @putchar(i32 78)
%19 = load i32, i32* %4
%20 = add nsw i32 %19, -1
store i32 %20, i32* %4
br label %27
21: ; preds = %12
%22 = icmp slt i32 %14, %15
br i1 %22, label %23, label %27
23: ; preds = %21
%24 = call i32 @putchar(i32 83)
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %27
27: ; preds = %21, %23, %17
%28 = load i32, i32* %3
%29 = load i32, i32* %1
%30 = icmp sgt i32 %28, %29
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = call i32 @putchar(i32 87)
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
br label %41
35: ; preds = %27
%36 = icmp slt i32 %28, %29
br i1 %36, label %37, label %41
37: ; preds = %35
%38 = call i32 @putchar(i32 69)
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %41
41: ; preds = %35, %37, %31
%42 = call i32 @putchar(i32 10)
br label %12
}