const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let [n,l]=t.n(2)
  l--;
  let d=t.abs(1+l);
  let a=1;
  for(let i=2;i<=n;i++){
    if(d>t.abs(i+l)){
      d=t.abs(i+l)
      a=i;
    }
  }
  let ans=0;
  for(let i=1;i<=n;i++){
    if(i==a)continue
    ans+=i+l;
  }
  t.o(ans)
}
main()


import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

const [n, l]: number[] = input[0].split(' ').map((x: string): number => +x);
let total: number = 0;
for(let i = l; i < n+l; i++){
    total += i;
}

if(l >= 0){
    console.log(total - l);
}else if (l < 0 && n+l-1 >= 0){
    console.log(total);
}else{
    console.log(total - (n+l-1));
}


const main = (lines: string) => {
  const data = lines.split(" ");
  const appleLength = parseInt(data[0], 10);
  const tastePoint = parseInt(data[1], 10);

  let tasteTotalValue = 0;
  let minTaste = 0;

  if (appleLength + tastePoint - 1 <= 0) {
    minTaste = Math.abs(appleLength + tastePoint - 1);
  } else if (tastePoint >= 0) {
    minTaste = Math.abs(tastePoint);
  }

  // 等差数列の和
  tasteTotalValue = (appleLength * (2 * tastePoint + appleLength - 1)) / 2;

  console.log(tasteTotalValue - minTaste);
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = (lines: string) => {
  const data = lines.split(" ");
  const appleLength = parseInt(data[0], 10);
  const tastePoint = parseInt(data[1], 10);
  let tastePoints: number[] = [];
  let taste;
  let tasteTotalValue = 0;

  for (let i = 1; i <= appleLength; i++) {
    tastePoints.push(Math.abs(i + tastePoint - 1));
    tasteTotalValue += i + tastePoint - 1;
  }

  console.log(tasteTotalValue - Math.min.apply(null, tastePoints));
};

main(require("fs").readFileSync("/dev/stdin", "utf8"));


r,d,x = map(int,input().split())
for i in range(10):
    x = r * x - d
    print(x)


r, D, x = [int(i) for i in input().split()]

for _ in range(10):
    y = r * x - D
    print(y)
    x = y


r,d,x = map(int, input().split())

for i in range(10):
  x = r*x - d
  print(x)


a,b,c = map(int,input().split())
for i in range(b):
    c = a*c-b
    print(c)


r, d, x = map(int, input().split())

for i in range(11):
  x = r * x - d
  print(x)


#ABC127 B

r,D,x = map(int,input().split())
A = []
for i in range(10):
    if i == 0:
        A.append(x)
    else:
        A.append(r*(A[i-1])-D)

for j in range(10):
    print(A[j])


import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        long r = sc.nextLong();
        long d = sc.nextLong();
        long x = sc.nextLong();
        for(int i=0; i<10; i++){
            x = r * x - d;
            System.out.println(x);
        }
    }

    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr]))
                ptr++;
            return hasNextByte();
        }

        public String next() {
            if (!hasNext())
                throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
	public static void main(String[] args){
		FastScanner sc = new FastScanner(System.in);

		int r = sc.nextInt();
		int D = sc.nextInt();
		int x = sc.nextInt();
		for (int i=0;i<10;i++) {
			x = r * x - D;
			System.out.println(x);
		}
	}

}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;

    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
     }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    }
}


import java.util.*;
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main{
    static long mod=1000000007;
    static int dx[]={-1,0,1,0};
    static int dy[]={0,-1,0,1};

    public  static void main(String[] args)   throws Exception, IOException{
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        long r=sc.nextLong();
        long d=sc.nextLong();
        long x=sc.nextLong();
        long ans=0;
        for (int i = 0; i < 10; i++) {
        	x=x*r-d;
            out.println(x);
		}

//        out.println(ans);
        out.flush();
    }

    static boolean validpos(int x,int y,int r, int c){
        return x<r && 0<=x && y<c && 0<=y;
    }

    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }
}

//class P {
//    int id, d;
//    P(int  id, int d) {
//        this.id=id;
//        this.d=d;
//    }
//}

//class P implements Comparable<P>{
//    long a,b;
//    int id;
//    P(long a, long b,int id) {
//        this.a=a;
//        this.b=b;
//        this.id=id;
//    }
//    public int compareTo(P p){
//    	if(a*b-p.a*p.b>0) return 1;
//    	if(-a*b+p.a*p.b>0) return -1;
//        return 0;
//    }
//}

class Reader
{
    private BufferedReader x;
    private StringTokenizer st;

    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public int[] nextIntArray(int size) throws IOException{
    	int r[] = new int[size];
    	for (int i = 0; i < size; i++) {
			r[i] = this.nextInt();
		}
    	return r;
    }
    public long[] nextLongArray(int size) throws IOException{
    	long r[] = new long[size];
    	for (int i = 0; i < size; i++) {
			r[i] = this.nextLong();
		}
    	return r;
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}


package abc127;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner  = new Scanner(System.in);
		final var r = scanner.nextInt();
		final var D = scanner.nextInt();
		var x = scanner.nextInt();
		for(int i = 0; i < 10; i++) {
			x =  r * x - D;
			System.out.println(x);
		}
		scanner.close();
	}

}


import java.util.*;

class Main {
public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        int D = sc.nextInt();
        int x = sc.nextInt();

        int sum = x;
        for (int i = 1; i <= 10; i++) {
            sum = i * sum - D;
            System.out.println(sum);
        }
    }
}


import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int r = sc.nextInt();
		int D = sc.nextInt();
		int X[] = new int[10];
		X[0] = sc.nextInt();

		for (int i = 1; i <= 10; i++) {
			X[i] = X[i - 1] * r + D;
			System.out.println(X[i]);
		}
		sc.close();
	}
};


#include <stdio.h>
int main ()
{
	int a[2001],i,r,D;
	    scanf ("%d %d %d",&r,&D,&a[0]);
	    for(i=0;i<10;i++)
	    {
		    a[i+1]=r*a[i]-D;
	    }
	    for (i=1;i<=10;i++)
	    {
		    printf ("%d\n",a[i]);
	    }
	    return 0;
}


#include <stdio.h>
typedef long long ll;

int main(void) {
  ll i, ans, d, r;
  scanf("%lld%lld%lld", &r, &d, &ans);
  for(i = 0; i < 10; ++i)
    ans = r * ans - d, printf("%lld\n", ans);
  return 0;
}


#include<iostream>
using namespace std;
int a,b,c,i;
int main(){
	cin>>a>>b>>c;
	for(i=0;i<10;i++){
		c*=a;
		c-=b;
		cout<<c<<endl;
	}
}


#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

// int max: 2 x 10^9, long long max: 9 x 10^18

using namespace std;

int main()
{
  long long r, d, x;
  cin >> r >> d >> x;

  vector<long long> result(10);
  result[0] = r * x - d;
  for(int i=1; i<10; i++){
    result[i] = r * result[i-1] - d;
    cout << result[i] << endl;
  }

  return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{
  int n,d,a[11];
  cin>>r>>d>>a[0];
  for(int i=1;i<=n;i++)
  {
    a[i]=a[i-1]*r-d;
    cout<<a[i]<<endl;

  }

  return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{
  int n,d,a[11];
  cin>>r>>d>>a[0];
  for(int i=1;i<=n;i++)
  {
    a[i]a[i-1]*r-d;
    cout<<a[i]<<endl;

  }

  return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

int main() {

    int r, d, x;
    scanf("%d %d %d", &r, &d, &x);

    for (int i = 1; i <= 10; i++) {

        int xtemp = r * x - d;
        printf("%d\n", xtemp);
        x = xtemp;

    }

    return 0;
}


#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>

int main()
{   long r,d,x[11];
    scanf("%ld%ld%ld",&r,&d,&x[0]);
    for(int i=1;i<11;i++){
        x[i]=r*x[i-1]-d;
        printf("%ld\n",x[i]);
    }
    return 0;
}


#include<stdio.h>
int main(){
    int r,d;
    int x;
    int i;
    int now;

    scanf("%d %d %d",&r,&d,&x);
    now = x;
    for(i=0;i<10;i++){
        now = now*r-d;
        printf("%d\n",now);
    }
    return 0;
}


#include<stdio.h>
int main(){
  int r,x,d;
  scanf("%d%d%d",&r,&d,&x);
  int a[11];
  a[0]=x;
  for(int i=0;i<10;i+=){
    a[i+1]=r*a[i]-d;
    printf("%d\n",a[i+1]);
  }
  return 0;
}


#include <stdio.h>
int main(){
  int r,D,x[12],ans;
  scanf("%d%d%d",&r,&D,&x[0]);

  for (int i=0;i<=11;i++){
    x[i+1]=r*x[i]-D;
  }

  for (int i=1;i<=11;i++){
    printf("%d",x[i]);
  }

  return 0;
}


'use strict'
function main(input) {
  input = input.trim().split(' ')
  const r = Number(input[0])
  const D = Number(input[1])
  let ans = [Number(input[2])]

  for (let i = 1; i <= 10; i++) {
    ans[i] = r * ans[i - 1] - D
  }

  ans.shift()
  console.log(ans.join('\n'))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


/*
-------関数一覧--------
arr1dto2d(Array) 一次元配列を二次元配列にします
pf(N)因数分解した結果をオブジェクトで返します
gcd(a,b)最大公約数を返します
lcm(a,b)最小公倍数を返します
num(a,b)a-bを返します。ソート用です
*/
function Main(input) {
  //write here!
  input = input.split(" ").map(Number);
  var now = input[2];
  for(var i=0;i<10;i++){
    now = (now*input[0])-input[1];
  console.log(now);
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
function arr1dto2d (arr){
	for(var i=0;i<arr.length;i++){
    arr[i]=arr[i].split(" ").map(Number);
    }
  return arr;
}
function pf(n) {
    var result = {};

    if (n === 1) {
        return {"1":1}
    }

    var init = 2;

    while (n !== 1) {
        var i = init;
        while (i < Number.MAX_SAFE_INTEGER) {
            if (n % i === 0) {
                n /= i;
                if (!(result[i] > 0)) {
                    result[i] = 0;
                }
                result[i]++;
                break;
            }
            i++;
        }
        init = i;
    }
    return result;
}
function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
function lcm(a,b) {
    var g = (n, m) => m ? g(m, n % m) : n
    return a * b / g(a, b)
}
function num(a, b) {
  return a - b;
}


function main(input){
  input = input.split("\n");
  var r = parseInt(input[0].split(" ")[0]);
  var d = parseInt(input[0].split(" ")[1]);
  var a = parseInt(input[0].split(" ")[2]);

  for (var i = 0; i < 10; i++) {
    a = r * a - d ;
    console.log(a);
  }

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


/*
-------関数一覧--------
arr1dto2d(Array) 一次元配列を二次元配列にします
pf(N)因数分解した結果をオブジェクトで返します
gcd(a,b)最大公約数を返します
lcm(a,b)最小公倍数を返します
num(a,b)a-bを返します。ソート用です
*/
function Main(input) {
  //write here!
  input = input.split(" ").map(Number);
  var now = inpur[2];
  for(var i=0;i<10;i++){
    now = (now*input[0])-input[1];
  console.log(now);
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
function arr1dto2d (arr){
	for(var i=0;i<arr.length;i++){
    arr[i]=arr[i].split(" ").map(Number);
    }
  return arr;
}
function pf(n) {
    var result = {};

    if (n === 1) {
        return {"1":1}
    }

    var init = 2;

    while (n !== 1) {
        var i = init;
        while (i < Number.MAX_SAFE_INTEGER) {
            if (n % i === 0) {
                n /= i;
                if (!(result[i] > 0)) {
                    result[i] = 0;
                }
                result[i]++;
                break;
            }
            i++;
        }
        init = i;
    }
    return result;
}
function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
function lcm(a,b) {
    var g = (n, m) => m ? g(m, n % m) : n
    return a * b / g(a, b)
}
function num(a, b) {
  return a - b;
}


/*
-------関数一覧--------
arr1dto2d(Array) 一次元配列を二次元配列にします
pf(N)因数分解した結果をオブジェクトで返します
gcd(a,b)最大公約数を返します
lcm(a,b)最小公倍数を返します
num(a,b)a-bを返します。ソート用です
*/
function Main(input) {
  //write here!
  input = input.split(" ").map(Number);
  var now = inpur[2]
  for(var i=0;i<10;i++){
    now = (now*input[0]-input[1];
  console.log(now);
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
function arr1dto2d (arr){
	for(var i=0;i<arr.length;i++){
    arr[i]=arr[i].split(" ").map(Number);
    }
  return arr;
}
function pf(n) {
    var result = {};

    if (n === 1) {
        return {"1":1}
    }

    var init = 2;

    while (n !== 1) {
        var i = init;
        while (i < Number.MAX_SAFE_INTEGER) {
            if (n % i === 0) {
                n /= i;
                if (!(result[i] > 0)) {
                    result[i] = 0;
                }
                result[i]++;
                break;
            }
            i++;
        }
        init = i;
    }
    return result;
}
function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
function lcm(a,b) {
    var g = (n, m) => m ? g(m, n % m) : n
    return a * b / g(a, b)
}
function num(a, b) {
  return a - b;
}


// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	const lines = input.split("\n");
	const params = lines[0].split(" ");
	//文字列から10進数に変換するときはparseIntを使います
	const r = parseInt(params[0], 10);
	const D = parseInt(params[1], 10);
	let x = parseInt(params[2], 10);
	//出力
    for (let i=0; i<10; i++){
      x = r * x - D;
      console.log(result);
    }
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	num, _ := strconv.Atoi(scanString())
	return num
}

func scanString() string {
	sc.Scan()
	return sc.Text()
}

func scanInts(n int) []int {
	sl := make([]int, n)
	for i := range sl {
		sl[i] = scanInt()
	}
	return sl
}

func scanStrings(n int) []string {
	sl := make([]string, n)
	for i := range sl {
		sl[i] = scanString()
	}
	return sl
}

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	r, D, x := scanInt(), scanInt(), scanInt()
	for i := 1; i <= 10; i++ {
		x = r*x - D
		fmt.Println(x)
	}
}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	r := getInt()
	D := getInt()
	x2000 := getInt()

	result := x2000
	for i := 1; i <= 10; i++ {
		result = r * result - D
		fmt.Println(result)
	}
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import (
  "fmt"
)

func main() {
  var r, d, x int
  fmt.Scan(&r, &d, &x)
  for i := 0; i < 10; i++ {
    x = r*x - d
    fmt.Println(x)
  }
}


package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	r := getInt()
	D := getInt()
	x2000 := getInt()

	result := x2000
	for i := 1; i <= 10; i++ {
		result = r * result - D
	}

	fmt.Println(result)
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func bfs(c int, graph *Graph) {
	next := make([]int, 0)
	next = append(next, c)
	visited := make(map[int]struct{})

	for ; len(next) != 0; {
		u := next[0]
		next = next[1:]
		visited[u] = struct{}{}

		for v := range graph.edges[u] {
			_, flag := visited[v]
			if flag {
				continue
			}

			// なにか処理

			next = append(next, v)
		}
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntArray(n int) []int {
	array := make([]int, n)
	for i := 0; i < n; i++ {
		array[i] = getInt()
	}
	return array
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n % 2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n % i == 0 {
			return false
		}
	}

	return true
}

func contains(s []int, e int) bool {
	for _, v := range s {
		if e == v {
			return true
		}
	}
	return false
}

func makeRange(min, max int) []int {
	a := make([]int, max-min+1)
	for i := range a {
		a[i] = min + i
	}
	return a
}

func powerset2(nums []int) [][]int {
	length := int(math.Pow(2, float64(len(nums))))
	result := make([][]int, length)

	index := 0
	result[index] = []int{}
	index++

	for _, n := range nums {
		max := index
		for i := 0; i < max; i++ {
			result[index] = copyAndAppend(result[i], n)
			index++
		}
	}

	return result
}

func copyAndAppend(nums []int, n int) []int {
	dst := make([]int, len(nums)+1)
	copy(dst, nums)
	dst[len(nums)] = n
	return dst
}

func calcGcd(x, y int) int {
	if y == 0 {
		return x
	} else if x >= y {
		return calcGcd(y, x % y)
	} else {
		return calcGcd(x, y % x)
	}
}

func getDivisor(n int) []int {
	var divisor []int
	divisor = append(divisor, 1)
	if n != 1 {
		divisor = append(divisor, n)
	}

	sqrt := int(math.Sqrt(float64(n)))
	for i := 2; i <= sqrt; i++ {
		if n % i == 0 {
			divisor = append(divisor, i)
			divisor = append(divisor, n/i)
		}
	}
	return divisor
}

type intHeap []int

func (h intHeap) Len() int {
	return len(h)
}

func (h intHeap) Less(i, j int) bool {
	return h[i] > h[j]
}

func (h intHeap) Swap(i, j int) {
	h[i], h[j] = h[j], h[i]
}

func (h *intHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *intHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func initHeap() *intHeap {
	ih := &intHeap{}
	heap.Init(ih)
	return ih
}

func (h *intHeap) pushHeap(n int) {
	heap.Push(h, n)
}

func (h *intHeap) popHeap() int {
	return heap.Pop(h).(int)
}

func factMod(n int) int {
	value := 1
	for ; n > 1; n-- {
		value = calcMod(value * n)
	}
	return value
}

func combinationMod(n, k int) int {
	factN := factMod(n)
	factK := factMod(k)
	factNK := factMod(n - k)
	factKR := powMod(factK, mod - 2)
	factNKR := powMod(factNK, mod - 2)
	return calcMod(factN * calcMod(factKR * factNKR))
}


package main

import (
    "fmt"
)

func main() {
    var r, D, x2000 int
    fmt.Scanln(&r, &D, &x2000)

    x := make([]int, 11)
    x[0] = x2000

    for i := 1; i <= 10; i++ {
        x[i] = r*x[i-1] - D
        fmt.Println(x[i])
    }
}
~


ｍ


r, d, x = gets.chomp.split.map(&:to_i)
10.times do
  x = r * x - d
  puts x
end


r, d, x = gets.split.map(&:to_i)

10.times do
  x = r * x - d
  puts x
end


#
# File    : B.rb
# Author  : Kazune Takahashi
# Created : 2019-5-25 21:02:10
# Powered by Visual Studio Code
#

r, d, x = gets.chomp.split(" ").map{|i| i.to_i}
for i in 0...10
  x = r * x - d
  puts x
end


r,d,x=gets.split.map(&:to_i)
i=0
while i<11
    x=r*x-d
    puts x
    i+=1
end


r,d,x=gets.split.map(&:to_i)
while i<11
    i=0
    x=rx-d
    puts x
    i+=1
end


r,D,x=gets.split.map(&:to_i)
ans=Array.new(11)

ans[0]=x
10.times do |i|
    ans[i+1] = ans[i] * r - D
end

puts ans


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        r: usize,
        d: usize,
        x: usize,
    }
    let mut x_tmp = x;
    for _i in 0..10 {
        x_tmp = r*x_tmp - d;
        println!("{}", x_tmp);
    }

}


#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

use std::cmp;
use std::iter::Iterator;

fn main() {
    input! {
        r:usize,
        d:usize,
        x:usize
    }

    let mut x_2000 = x;

    for i in 0..10 {
        println!("{}", r * x_2000 - d);
        x_2000 =  r * x_2000 - d;

    }
}


// Your code here!

use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main(){
    let nums: Vec<i32> = read_vec();
    let mut temp : i32 = nums[2];
    for i in 0..10{
        temp=nums[0]*temp-nums[1];
        println!("{:?}",temp);
    }

}


use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let r: i32 = input();
    let d: i32 = input();
    let x0: i64 = input();

    let mut x = x0;
    for i in 1..11 {
        x = r * x - d;
        println!("{}", x);
    }
}


fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let mut input = buf.split_whitespace();
    let (r, d, x2000) = (
        input.next().unwrap().parse().unwrap(),
        input.next().unwrap().parse().unwrap(),
        input.next().unwrap().parse().unwrap(),
    );

    doa(r, d, x2000)
        .into_iter()
        .for_each(|i| println!("{}", i));
}

fn doa(r: u64, d: u64, x2000: u64) -> Vec<u64> {
    let mut v = Vec::with_capacity(10);
    let mut xi = x2000;
    for _ in 0..10 {
        xi = r * xi - d;
        v.push(xi)
    }
    v
}


mod io{
    use std::io::*;
    pub fn read<T: ::std::str::FromStr>()->T{
        let stdin=stdin();
        let ret=stdin.lock().bytes().map(|c|c.unwrap()as char)
        .skip_while(|c|c.is_whitespace())
        .take_while(|c|!c.is_whitespace())
        .collect::<String>().parse().ok().unwrap();
        ret
    }
}
use io::read;
fn main(){
    let r=read::<i32>();
    let d=read::<i32>();
    let mut x=read::<i32>();
    for _ in 0..=9{
        x=x*r-d;
        println!("{}",x)
    }
}


var arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var x = ( arr[0] ) * arr[2] - arr[1]
print( x )
for var i = 0; i < 9; i+=1 {
  x = ( arr[0]  ) * x - arr[1]
  print( x )
}


let input = readLine()!.split(separator: " ").map { Int($0)! }

let r = input[0]
let D = input[1]
var x = input[2]

for i in 0..<10 {
  x = r * x - D
  print(x)
}


import Foundation

let input_line = readLine()!

let split = input_line.componentsSeparatedByString(" ") //components(separatedBy:)と実質同じ
let r = Int(split[0])!
let D = Int(split[1])!
var x2000 = Int(split[2])!

func calculateWeight(year: Int) -> Int {
	var oneYearAgoWeight = 0
	var weight = 0
	if year > 2001 {
      	oneYearAgoWeight += calculateWeight(year - 1)
  		weight = r * oneYearAgoWeight - D
	} else if year == 2001 {
    	weight = r * x2000 - D
    } else {
    	print("Error")
    }
	return weight
}

var i = 2001
while i < 2011 {
	print(calculateWeight(i))
	i += 1
}


import Foundation

extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
}

func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/************** main *****************/

let rdx = readIntSplit(by: " ")
var (r, d, x) = (rdx[0], rdx[1], rdx[2])
for i in 0 ..< 10 {
    x = r * x - D
    print(x)
}


const main = (input: string) => {
    let [r, D, x] = input.trim().split(" ").map(str => parseInt(str))
    const OUTPUT_LINE = 10;
    let answer: string = "";

    for (let i = 0; i < OUTPUT_LINE; i++) {
        if (i !== OUTPUT_LINE - 1) {
            answer = `${answer}${r * x - D}\n`;
        } else {
            answer = `${answer}${r * x - D }`;
        }
        x = r * x - D
    }

    console.log(answer);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


import * as fs from 'fs';

namespace AtCoder.abc001 {

    class Program {
        args: string[];

        constructor(args: string[]) {
            this.args = args;
        }

        /**
         * in
         2 10 20
         * out
         30
         50
         90
         170
         330
         650
         1290
         2570
         5130
         10250
         */
        main(): void {
            const [r, d, x]: number[] = this.args[0].split(' ').map(Number);
            // x[i+1] = rx[i] -d

            let wkX: number = x;
            for (let i: number = 0; i < 10; i++) {
                console.log((r * wkX) - d);
                wkX = (r * wkX) - d;
            }
        }
    }

    const args = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    const prg = new Program(args);
    prg.main();
}


const main = (input: string) => {
  let [r, D, x] = input.trim().split(" ").map(str => parseInt(str))
  const OUTPUT_LINE = 10;
  let answer: string = "";

  for (let i = 0; i < OUTPUT_LINE; i++) {
    answer = `${answer}${r * x - D}\n`;
    x = r * x - D
  }

  console.log(answer.trim());
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


const input = "2 10 20";

const main = (input: string) => {
  let [r, D, x] = input.trim().split(" ").map(str => parseInt(str))
  const OUTPUT_LINE = 10;
  let answer: string = "";

  for (let i = 0; i < OUTPUT_LINE; i++) {
    answer = `${answer}${r * x - D}\n`;
    x = r * x - D
  }

  console.log(answer.trim());
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = (input: string) => {
    let [r, D, x] = input.trim().split(" ").map(str => parseInt(str))
    const OUTPUT_LINE = 10;
    let answer: string = "";

    for (let i = 0; i < OUTPUT_LINE; i++) {
        answer = `${answer}${r * x - D }\n`;
        x = r * x - D
    }

    console.log(answer);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


N, M, X, Y = map(int, input().split()) # 横に2個
Xs = list(map(int, input().split()))
Ys = list(map(int, input().split()))

Xs.sort()
Ys.sort()

if max(Xs[-1], X) < min(Ys[0], Y):
    ans = 'No War'
else:
    ans = 'War'

print(ans)


N,M,X,Y = (int(x) for x in input().split())
x_arr = sorted([int(x) for x in input().split()]+[X])
y_arr = sorted([int(x) for x in input().split()]+[Y])

if(x_arr[-1] < y_arr[0]):
    print("No War")
else:
    print("War")


n,m,x,y=map(int,input().split())

xs=list(map(int,input().split()))
ys=list(map(int,input().split()))

#print(x)
#print(y)

x_max=int(max(xs))
y_min=int(min(ys))

if x_max<y_min and y_min<y and y_min!=x:
    print("No War")

else:
    print("War")


n, m, a, b = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

if max(x) < min(y) and a < b:
    print('No War')
else:
    print('War')


n,m,x,y = map(int,input().split())
a = max(list(map(int,input().split())))
b = max(list(map(int,input().split())))
ans = "War"
for i in range(x+1,y):
    if i>a and i<=b:
        ans = "No War"
print(ans)


n,m,x,y = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
max_x = max(a)
max_y = max(b)
max_x = max(max_x,x)
max_y = max(max_y,y)

if max_x < max_y:
  print("No War")
else:
  print("War")


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;

class Main{

	static void solve(){
		int n=ni(), m=ni(), X=ni(), Y=ni();
		int[] x = nia(n);
		int[] y = nia(m);
		for(int i=0;i<n;++i)X = Math.max(X, x[i]);
		for(int i=0;i<m;++i)Y = Math.min(Y, y[i]);
		if(X+1<=Y)out.println("No War");
		else out.println("War");

	}

	 public static void main(String[] args){
		 solve();
		 out.flush();
	 }
	 private static InputStream in = System.in;
	 private static PrintWriter out = new PrintWriter(System.out);

	 static boolean inrange(int y, int x, int h, int w){
		 return y>=0 && y<h && x>=0 && x<w;
	 }
	 @SuppressWarnings("unchecked")
	 static<T extends Comparable> int lower_bound(List<T> list, T key){
		 int lower=-1;int upper=list.size();
		 while(upper - lower>1){
		 int center =(upper+lower)/2;
		 if(list.get(center).compareTo(key)>=0)upper=center;
		 else lower=center;
		 }
		 return upper;
	 }
	 @SuppressWarnings("unchecked")
	 static <T extends Comparable> int upper_bound(List<T> list, T key){
		 int lower=-1;int upper=list.size();
		 while(upper-lower >1){
		 int center=(upper+lower)/2;
		 if(list.get(center).compareTo(key)>0)upper=center;
		 else lower=center;
		 }
		 return upper;
	 }
	 @SuppressWarnings("unchecked")
	 static <T extends Comparable> boolean next_permutation(List<T> list){
		 int lastIndex = list.size()-2;
		 while(lastIndex>=0 && list.get(lastIndex).compareTo(list.get(lastIndex+1))>=0)--lastIndex;
		 if(lastIndex<0)return false;
		 int swapIndex = list.size()-1;
		 while(list.get(lastIndex).compareTo(list.get(swapIndex))>=0)swapIndex--;
		 T tmp = list.get(lastIndex);
		 list.set(lastIndex++, list.get(swapIndex));
		 list.set(swapIndex, tmp);
		 swapIndex = list.size()-1;
		 while(lastIndex<swapIndex){
		 tmp = list.get(lastIndex);
		 list.set(lastIndex, list.get(swapIndex));
		 list.set(swapIndex, tmp);
		 ++lastIndex;--swapIndex;
		 }
		 return true;
	 }
	 private static final byte[] buffer = new byte[1<<15];
	 private static int ptr = 0;
	 private static int buflen = 0;
	 private static boolean hasNextByte(){
		 if(ptr<buflen)return true;
		 ptr = 0;
		 try{
			 buflen = in.read(buffer);
		 } catch (IOException e){
			 e.printStackTrace();
		 }
		 return buflen>0;
	 }
	 private static int readByte(){ if(hasNextByte()) return buffer[ptr++]; else return -1;}
	 private static boolean isSpaceChar(int c){ return !(33<=c && c<=126);}
	 private static int skip(){int res; while((res=readByte())!=-1 && isSpaceChar(res)); return res;}

	 private static double nd(){ return Double.parseDouble(ns()); }
	 private static char nc(){ return (char)skip(); }
	 private static String ns(){
		 StringBuilder sb = new StringBuilder();
		 for(int b=skip();!isSpaceChar(b);b=readByte())sb.append((char)b);
		 return sb.toString();
	 }
	 private static int[] nia(int n){
		 int[] res = new int[n];
		 for(int i=0;i<n;++i)res[i]=ni();
		 return res;
	 }
	 private static long[] nla(int n){
		 long[] res = new long[n];
		 for(int i=0;i<n;++i)res[i]=nl();
		 return res;
	 }
	 private static int ni(){
		 int res=0,b;
		 boolean minus=false;
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
		 if(b=='-'){
			 minus=true;
			 b=readByte();
		 }
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
		 return minus ? -res:res;
	 }
	 private static long nl(){
		 long res=0,b;
		 boolean minus=false;
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-'));
		 if(b=='-'){
			 minus=true;
			 b=readByte();
		 }
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0');
		 return minus ? -res:res;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	static FastScanner sc;
	static PrintWriter out;
	public static void main(String[] args){
		sc = new FastScanner();
		out = new PrintWriter(System.out);
		out.println(solve());
		out.flush();
	}

	static String solve(){
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int max = X;
		int min = Y;
		for(int i=0;i<N;i++){
			max = Math.max(max, sc.nextInt());
		}
		for(int i=0;i<M;i++){
			min = Math.min(min, sc.nextInt());
		}
		if(max >= min) return "War";
		else return "No War";
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


import java.io.*;
import java.util.*;
import java.math.*;
// import java.awt.Point;

public class Main {
    InputStream is;
    PrintWriter out;
    String INPUT = "";

    static int mod = 1_000_000_007;
    long inf = Long.MAX_VALUE;

    void solve(){
        int n = ni();
        int m = ni();
        int x = ni();
        int y = ni();
        int[] a = new int[n+1];
        int[] b = new int[m+1];
        for(int i = 0; i < n; i++){
            a[i] = ni();
        }
        for(int i = 0; i < m; i++){
            b[i] = ni();
        }
        a[n] = x;
        b[m] = y;
        Arrays.sort(a);
        Arrays.sort(b);
        if(b[0]>a[n]){
            out.println("No War");
        }
        else{
            out.println("War");
        }

    }

    void run() throws Exception
    {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        out.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception { new Main().run(); }

    private byte[] inbuf = new byte[1024];
    private int lenbuf = 0, ptrbuf = 0;

    private int readByte()
    {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns()
    {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b) && b != ' ')){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n)
    {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m)
    {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n)
    {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni()
    {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl()
    {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static void tr(Object... o) { System.out.println(Arrays.deepToString(o)); }

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		int[] x = new int[N];
		int[] y = new int[M];
		int z1 = X;
		int z2 = Y;
		for(int i=0; i<N; i++) {
			x[i] = sc.nextInt();
			z1 = Math.max(z1, x[i]);
		}
		for(int i=0; i<M; i++) {
			y[i] = sc.nextInt();
			z2 = Math.max(z2, y[i]);
		}
		sc.close();
		System.out.println(z1 < z2 ? "No War":"War");
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		int Y = sc.nextInt();
		boolean flag = false;
		int[] A = new int[N];
		int[] B = new int[M];
		for(int i=0; i<N; i++) {
			A[i] = sc.nextInt();
		}
		for(int i=0; i<M; i++) {
			B[i] = sc.nextInt();
		}
		for(int i=X+1; i<=Y; i++) {
			for(int j=0; j<N; j++) {
				if(!(i>A[j])) {
					break;
				}
			}
			for(int j=0; j<M; j++) {
				if(!(i<=B[j])) {
					break;
				}
			}
			flag = true;
			break;
		}

		if(flag==false) {
			System.out.println("War");
		}
		else {
			System.out.println("No War");
		}
	}

}


import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt(), M = sc.nextInt();
		int[] A = new int[N], B = new int[M];
		int X = sc.nextInt(), Y = sc.nextInt();
		for (int i=0; i<A.length; i++){
			A[i] = sc.nextInt();
		}
		for (int i=0; i<B.length; i++){
			B[i] = sc.nextInt();
		}
		boolean ok = true;
		for (int i=0; i<A.length; i++){
			if (X<A[i] && Y>=A[i]){
				for (int j=0; j<A.length; j++){
					if (!(A[i]>A[j])){
						ok = false;
						break;
					}
				}

				for (int j=0; j<B.length; j++){
					if (ok==false){
						break;
					}
					if (!(A[i]<=B[j])){
						ok = false;
						break;
					}
				}
				if (ok==true){
					break;
				}
			}
		}
		boolean yes = true;
		for (int i=0; i<B.length; i++){
			if (X<B[i] && Y>=B[i]){
				for (int j=0; j<A.length; j++){
					if (!(B[i]>A[j])){
						yes = false;
						break;
					}
				}

				for (int j=0; j<B.length; j++){
					if (yes==false){
						break;
					}
					if (!(B[i]<=B[j])){
						yes = false;
						break;
					}
				}
				if (yes==true){
					break;
				}
			}
		}
		if (ok || yes){
			System.out.println("No War");
		}else{
			System.out.println("War");
		}
	}

}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n, m, x, y;
    cin >> n >> m >> x >> y;
    vector<int> xv(n), yv(m);
    for(int i = 0; i < n; i++){
        cin >> xv[i];
    }
    for(int i = 0; i < m; i++){
        cin >> yv[i];
    }
    sort(xv.begin(),xv.end(), greater<int>());
    sort(yv.begin(),yv.end());
    int ans = false;
    for(int z = xv[0]+1; z <= yv[0]; z++){
        if(z > x && z < y) ans = true;
    }
    if(ans){
        cout << "No War" << endl;
    } else {
        cout << "War" << endl;
    }
    return 0;
}


#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<vector>

int main() {

   int N, M, X, Y;
   std::cin >> N >> M >> X >> Y;
   int x;
   int y;

   for (int i = 0; i < N; i++) {
      int tmp;
      std::cin >> tmp;
      if (i == 0) x = tmp;
      if (tmp > x) x = tmp;
   }
   for (int i = 0; i < M; i++) {
      int tmp;
      std::cin >> tmp;
      if (i == 0) y = tmp;
      if (tmp < y) y = tmp;
   }
   for (int i = X + 1; i <= Y; i++) {
      if (x < i && i <= y) {
         std::cout << "No War" << std::endl;
         return 0;
      }

   }
   std::cout << "War" << std::endl;
   return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
#include <iomanip>
#include <queue>
using namespace std;
int main() {
	int n, m, x, y;
    cin >> n >> m >> x >> y;
    int xx[200], yy[200];
    for(int i = 0; i < n; i++) cin >> xx[i];
    for(int j = 0; j < m; j++) cin >> yy[j];
    int xcounter = 0;
    int ycounter = 0;
    bool ans = 0;
    for(int k = x+1; k <= y; k++){
         for(int i = 0; i < n; i++){
             if(k > xx[i]) xcounter++;
         }
         for(int j = 0; j < m; j++){
             if(k <= yy[j]) ycounter++;
         }
         if(xcounter == n and ycounter == m){
             ans = 1;
             //cout << k << endl;
             break;
         }
         xcounter = 0;
         ycounter = 0;
    }

    if(ans == 1) cout << "No War" << endl;
    else cout << "War" << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main()
{
   int x, y, n, m, xi, yi, xmax=INT32_MIN, ymin=__INT32_MAX__;
   cin>>n>>m>>x>>y;
   for (int i = 0; i < n; i++)
   {
       cin>>xi;
       xmax = max(xmax, xi);
   }
   for (int i = 0; i < m; i++)
   {
       cin>>yi;
       ymin = min(ymin, yi);
   }
   if(x<y && xmax<ymin){
       cout<<"No War";
   }
   else
   {
       cout<<"War";
   }

   return 0;
}


#define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;
using ll = long long;
using P = pair<int, int>;

#define REP(i, x) for (int i = 0; i < (int) (x); i++)
#define REPS(i, x) for (int i = 1; i <= (int) (x); i++)
#define RREP(i, x) for (int i = ((int) (x) -1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int) (x)); i > 0; i--)
#define ALL(x) ((x).begin(), (x).end())
#define SIZE(x) ((int) (x).size())
#define BITS(x) (1LL << (x))

constexpr int INF = 1001001001;
constexpr ll LINF = 1001001001001001001LL;
constexpr int MOD = 1000000007;
constexpr double EPS = 1e-10;
constexpr double PI = 3.141592653589793;
constexpr int dx4[4] = {1, 0, -1, 0};
constexpr int dy4[4] = {0, 1, 0, -1};
constexpr int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
constexpr int dy8[8] = {1, 0, -1, 1, -1, 1, 0, -1};

random_device seed_gen;
mt19937 mrand(seed_gen());
mt19937_64 mrand64(seed_gen());
int rand32(int x) {
	return mrand() % x;
}
ll rand64(long x) {
	return mrand64() % x;
}

template<typename A, typename B> ostream& operator<<(ostream& out, const pair<A, B>& a) {
	out << "(" << a.first << "," << a.second << ")";
	return out;
}
template<typename T, size_t N> ostream& operator<<(ostream& out, const array<T, N>& a) {
	out << "[";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "]";
	return out;
}
template<typename T> ostream& operator<<(ostream& out, const vector<T>& a) {
	out << "[";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "]";
	return out;
}
template<typename T, class Cmp> ostream& operator<<(ostream& out, const set<T, Cmp>& a) {
	out << "{";
	bool first = true;
	for (auto& v : a) {
		out << (first ? "" : ",");
		out << v;
		first = 0;
	}
	out << "}";
	return out;
}
template<typename U, typename T, class Cmp> ostream& operator<<(ostream& out, const map<U, T, Cmp>& a) {
	out << "{";
	bool first = true;
	for (auto& p : a) {
		out << (first ? "" : ",");
		out << p.first << ": " << p.second;
		first = 0;
	}
	out << "}";
	return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template<typename Arg1> void __f(const char* name, Arg1&& arg1) {
	cerr << name << ": " << arg1 << endl;
}
template<typename Arg1, typename... Args> void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << ": " << arg1 << " |";
	__f(comma + 1, args...);
}

struct fast_ios {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	fast_ios() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH) cout << unitbuf;
	}
} fast_ios_;

int main() {
	int n, m, X, Y;
	cin >> n >> m >> X >> Y;
	int maxx, miny;
	maxx = -INF, miny = INF;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		maxx = max(maxx, x);
	}
	for (int i = 0; i < m; i++) {
		int y;
		cin >> y;
		miny = min(miny, y);
	}
	if (max(X + 1, maxx) <= min(Y, miny)) {
		cout << "No War" << endl;
	} else {
		cout << "War" << endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,n) for(int i=1;i<(int)(n);i++)

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

ll lcm(ll a, ll b) { //最小公倍数
  return a * b / gcd(a, b);
}

ll digit_sum(ll a){ //10進桁和
  ll ans=0;
  while(a>0){
    ans+=a%10;
    a/=10;
  }
  return ans;
}

int main()
{
  ll n,m,X,Y,x[110],y[110];
  cin>>n>>m>>X>>Y;
  rep(i,n)cin>>x[i];
  rep(i,m)cin>>y[i];

  for(ll i=X+1;i<=Y;i++){
    ll tmp1=0,tmp2=0;
    rep(j,n){
      if(x[j]>=i){
        tmp1++;
      }
    }
    rep(k,m){
      if(y[k]<i){
        tmp2++;
      }
    }
    if(tmp1==0&&tmp2==0){
      cout<<"No war"<<endl;
      return 0;
    }
  }

  cout<<"War"<<endl;
  return 0;
}


#include <stdio.h>

int main(void)
{
        int n,m,x,y,i,j,c,s;
        scanf("%d%d%d%d",&n,&m,&x,&y);
        int a[n],b[m];
        for(i=0;i<n;i++)
                scanf("%d",&a[i]);
        for(i=0;i<m;i++)
                scanf("%d",&b[i]);

        for(i=x+1;i<=y;i++){
                c=0;s=0;
                for(j=0;j<n;j++)
                        if(a[j]<i)c++;
                for(j=0;j<m;j++)
                        if(b[j]>=i)s++;
                if(c==n && s==m){
                        printf("No War\n");
                        return 0;
                }
        }
        printf("War\n");
        return 0;
}


#include<stdio.h>
int main(void){
	int n,m,x,y;
	int a,max=-100,min=100;
	scanf("%d %d %d %d",&n,&m,&x,&y);
	while(n){
		scanf("%d",&a);
		max=max<a?a:max;
		n--;
	}
	while(m){
		scanf("%d",&a);
		min=a<min?a:min;
		m--;
	}
	if(max<min){
		for(int i=max+1;i<=min;i++){
			if(x<i&&i<=y){n=1;}
		}
	}
	printf(n?"No War":"War");
	return 0;
}


#include<stdio.h>
int main()
{
	int n,m,x,y,t;

	scanf("%d%d%d%d",&n,&m,&x,&y);
	while(n--){
		scanf("%d",&t);
		x=x>t?x:t;
	}
	while(m--){
		scanf("%d",&t);
		y=y<t?y:t;
	}
	if(x<y)
		printf("No ");
	printf("War\n");
	return 0;
}


#include<stdio.h>

int main() {
  int N, M, x, y, xMax = 0, yMin = 0;
  scanf("%d %d %d %d",  &N, &M, &x, &y);
  int X[N], Y[M];
  for(int i = 0; i < N; i++) {
    scanf("%d", &X[i]);
  }

  for(int i = 0; i < M; i++) {
    scanf("%d", &Y[i]);
  }
  xMax = X[0];
  yMin = Y[0];

  for(int i = 1; i < N; i++) {
    if(xMax < X[i]) {
      xMax = X[i];
    }
  }

  for(int i = 1; i < M; i++) {
    if(yMin > Y[i]) {
      yMin = Y[i];
    }
  }

  if(yMin > xMax && x <= xMax && y >= yMin && x < y) {
    printf("No war\n");
  } else {
    printf("war\n");
  }
  return 0;
}


#include<stdio.h>

int main() {
  int N, M, x, y, xMax = 0, yMin = 0;
  scanf("%d %d %d %d",  &N, &M, &x, &y);
  int X[N], Y[M];
  for(int i = 0; i < N; i++) {
    scanf("%d", &X[i]);
  }

  for(int i = 0; i < M; i++) {
    scanf("%d", &Y[i]);
  }
  xMax = X[0];
  yMin = Y[0];

  for(int i = 1; i < N; i++) {
    if(xMax < X[i]) {
      xMax = X[i];
    }
  }

  for(int i = 1; i < M; i++) {
    if(yMin > Y[i]) {
      yMin = Y[i];
    }
  }

  printf("%d %d\n", xMax, yMin);
  if(yMin > xMax && x <= xMax && y >= yMin && x < y) {
    printf("no war\n");
  } else {
    printf("war\n");
  }
  return 0;
}


#include<stdio.h>

int main() {
  int N, M, x, y, xMax = 0, yMin = 0;
  scanf("%d %d %d %d",  &N, &M, &x, &y);
  int X[N], Y[M];
  for(int i = 0; i < N; i++) {
    scanf("%d", &X[i]);
  }

  for(int i = 0; i < M; i++) {
    scanf("%d", &Y[i]);
  }
  xMax = X[0];
  yMin = Y[0];

  for(int i = 1; i < N; i++) {
    if(xMax < X[i]) {
      xMax = X[i];
    }
  }

  for(int i = 1; i < M; i++) {
    if(yMin > Y[i]) {
      yMin = Y[i];
    }
  }

  printf("%d %d\n", xMax, yMin);
  if(yMin > xMax && x <= xMax && y >= yMin && x < y) {
    printf("no war\n");
  } else {
    printf("war\n");
  }
  return;
}


inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')
l = inp.shift().split(' ')
N = l.shift() * 1
M = l.shift() * 1
X = l.shift() * 1
Y = l.shift() * 1
xa = inp.shift().split(' ')
xa.push(X)
ya = inp.shift().split(' ')
ya.push(Y)
l = X
r = Y
for (i=0; i<N; i++) {
    if (l < xa[i] * 1) {
        l = xa[i] * 1
    }
}
for (i=0; i<M; i++) {
    if (r > ya[i] * 1) {
        r = ya[i] * 1
    }
}
if (l < r) {
    console.log('No War')
} else {
    console.log('War')
}


function main(input) {
  const formatted_input = input.split('\n').map( x => x.split(' ').map( x => parseInt(x, 10) ) );

  const first = formatted_input[0];
  const N = first[0];
  const M =first[1];
  const X = first[2];
  const Y = first[3];

  const Xs = formatted_input[1];
  const Ys = formatted_input[2];

  var max_x = -101;
  for(var x of Xs){ max_x = Math.max(x, max_x);}
  max_x = Math.max(X, max_x);

  var min_y = 101;
  for(var y of Ys){ min_y = Math.min(y, min_y);}
  min_y = Math.min(Y, min_y);

  if(max_x < min_y){
    console.log('No War');
  }else{
    console.log('War');
  }

}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


// inputに入力データ全体が入る
function Main(input) {
  var str = input.split('\n');

  var tmp = str[0].split(' ');
  var N = parseInt(tmp[0]);
  var M = parseInt(tmp[1]);
  var X = parseInt(tmp[2]);
  var Y = parseInt(tmp[3]);

  var tmp2 = str[1].split(' ');
  var numX = [];
  for (var i = 0; i < N; i++){
    numX.push(parseInt(tmp2[i]));
  }
  // 降順
  numX.sort(function(a, b){
    return (b - a);
  });

  var tmp3 = str[2].split(' ');
  var numY = [];
  for (var i = 0; i < M; i++){
    numY.push(parseInt(tmp3[i]));
  }
  // 昇順
  numY.sort(function(a, b){
    return (a - b);
  });

  if(numY[0] - numX[0] <= 0){
    console.log("%s", 'War');
    return;
  }

  if(X >= numX[0]){
    console.log("%s", 'War');
    return;
  }

  if (numY[0] > Y){
    console.log("%s", 'War');
    return;
  }

  console.log("%s", 'No War');
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const main = stdin => {
  const input = stdin.trim().split('\n')

  const [N, M, X, Y] = input[0].split(' ').map(x => parseInt(x))

  const xs = input[1].split(' ').map(x => parseInt(x))
  const ys = input[2].split(' ').map(x => parseInt(x))

  let xMax = -99999
  for (let i = 0; i < N; i++) {
    if (xs[i] > X && xs[i] > xMax) {
      xMax = xs[i]
    }
  }

  let yMin = 99999
  for (let i = 0; i < N; i++) {
    if (ys[i] <= Y && ys[i] <= yMin) {
      yMin = ys[i]
    }
  }

  if (xMax !== -99999 && yMin !== 99999 && xMax < yMin) {
    console.log('No war')
  } else {
    console.log('war')
  }
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))


var output;
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す
//1:数値へ変換 2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字に分割 7:1文字に分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main() {
  var one = myconv(next(),4);
  var N = one[0];
  var M = one[1];
  var X = one[2] + 100;
  var Y = one[3] + 100;
  var list = new Array(201);
  list[X] = "X";
  list[Y] = "Y";
  var xlist = myconv(next(),4);
  for(var i = 0; i < N; i++){
    list[xlist[i] + 100] = "X";
  }
  var ylist = myconv(next(),4);
  for(var i = 0; i < M; i++){
    list[ylist[i] + 100] = "Y";
  }
  N++;
  var count = 0;
  while(N != 0){
        if(list[count] == "X"){
           N--;
        }
    	if(list[count] == "Y"){
           myout("War");
          return;
        }
    count++;
  }
  myout("No War");
}


/*
-------関数一覧--------
arr1dto2d(Array) 一次元配列を二次元配列にします
pf(N)因数分解した結果をオブジェクトで返します
gcd(a,b)最大公約数を返します
lcm(a,b)最小公倍数を返します
*/
function Main(input) {
  //write here!
  var flag = false;
  var N = Math.ceil(input/7);
  var M = 0;
  while(N>0){
    if(N*7+M*4==input){
      flag = true;
      break;
    }else{
      N--;
      while(N*7+M*4<input){
      M++;
      }
    }
  }
  if(flag) console.log("Yes");
  else console.log("No");
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
function arr1dto2d (arr){
	for(var i=0;i<arr.length;i++){
    arr[i]=arr[i].split(" ").map(Number);
    }
  return arr;
}
function pf(n) {
    var result = {};

    if (n === 1) {
        return {"1":1}
    }

    var init = 2;

    while (n !== 1) {
        var i = init;
        while (i < Number.MAX_SAFE_INTEGER) {
            if (n % i === 0) {
                n /= i;
                if (!(result[i] > 0)) {
                    result[i] = 0;
                }
                result[i]++;
                break;
            }
            i++;
        }
        init = i;
    }
    return result;
}
function gcd(a, b) {
    if (b === 0){
        return a
    }
    return gcd(b, a % b)
}
function lcm(a,b) {
    var g = (n, m) => m ? g(m, n % m) : n
    return a * b / g(a, b)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	N, M, X, Y := readInt(), readInt(), readInt(), readInt()
	x := make([]int64, N)
	y := make([]int64, M)
	for i := int64(0); i < N; i++ {
		x[i] = readInt()
	}
	for i := int64(0); i < M; i++ {
		y[i] = readInt()
	}
	maxX := max(x...)
	minY := min(y...)
	for i := X + 1; i <= Y; i++ {
		if maxX < i && minY >= i {
			fmt.Println("No War")
			return
		}
	}
	fmt.Println("War")
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N, M, X, Y := sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()
	x := sc.nextIntSlice(N)
	y := sc.nextIntSlice(M)
	ok := false
	for z := X + 1; z <= Y; z++ {
		xOk := true
		for _, v := range x {
			if z <= v {
				xOk = false
				break
			}
		}
		yOk := true
		for _, v := range y {
			if z > v {
				yOk = false
				break
			}
		}
		if xOk && yOk {
			ok = true
			break
		}
	}

	if ok {
		fmt.Fprintln(wtr, "No War")
	} else {
		fmt.Fprintln(wtr, "War")
	}
	wtr.Flush()
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func max(nums []int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

func min(nums []int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	n, m, x, y := nextInt(), nextInt(), nextInt(), nextInt()
	maxX := max(nextInts(n))
	minY := min(nextInts(m))
	ok := false
	for z := maxX + 1; z <= minY; z++ {
		if x < z && z <= y {
			ok = true
			break
		}
	}
	if ok {
		puts("No War")
	} else {
		puts("War")
	}
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	"strings"
)

func main() {
	io, flush := NewIO()
	defer flush()

	n, m, x, y := io.ScanInt4()
	xlist := io.ScanInts(n)
	ylist := io.ScanInts(m)

	sort.Ints(xlist)
	sort.Ints(ylist)

	for i := xlist[len(xlist)-1]; i <= ylist[0]; i++ {
		if x < i && i <= y {
			fmt.Println("No War")
			return
		}
	}
	fmt.Println("War")
}

type IO struct {
	scanner *bufio.Scanner
	writer  *bufio.Writer
}

func NewIO() (*IO, func()) {
	io := &IO{
		scanner: newScanner(),
		writer:  newWriter(),
	}
	return io, func() { io.writer.Flush() }
}

func newScanner() *bufio.Scanner {
	s := bufio.NewScanner(os.Stdin)
	s.Buffer(make([]byte, 10000000), 10000000)
	s.Split(bufio.ScanWords)
	return s
}

func newWriter() *bufio.Writer {
	return bufio.NewWriter(os.Stdout)
}

func (io *IO) ScanBytes() []byte {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Bytes()
}

func (io *IO) ScanString() string {
	if !io.scanner.Scan() {
		panic("scan string failed")
	}
	return io.scanner.Text()
}

func (io *IO) ScanStrings(n int) []string {
	strs := make([]string, n)
	for i := 0; i < n; i++ {
		strs[i] = io.ScanString()
	}
	return strs
}

func (io *IO) Scan2DStrings(y, x int) [][]string {
	strings := make([][]string, y)
	for i := 0; i < y; i++ {
		strings[i] = io.ScanStrings(x)
	}
	return strings
}

func (io *IO) Scan2DGraph(y int) [][]string {
	strs := make([][]string, y)
	for i := 0; i < y; i++ {
		strs[i] = strings.Split(io.ScanString(), "")
	}
	return strs
}

func (io *IO) ScanInt() int {
	return int(io.ScanInt64())
}

func (io *IO) ScanInt2() (int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt3() (int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInt4() (int, int, int, int) {
	return int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64()), int(io.ScanInt64())
}

func (io *IO) ScanInts(n int) []int {
	ints := make([]int, n)
	for i := 0; i < n; i++ {
		ints[i] = io.ScanInt()
	}
	return ints
}

func (io *IO) Scan2DInts(y, x int) [][]int {
	ints := make([][]int, y)
	for i := 0; i < y; i++ {
		ints[i] = io.ScanInts(x)
	}
	return ints
}

func (io *IO) ScanInt64() int64 {
	i, err := strconv.ParseInt(io.ScanString(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *IO) ScanFloat64() float64 {
	i, _ := strconv.ParseFloat(io.ScanString(), 64)
	return i
}

func (io *IO) ScanFloat64s(n int) []float64 {
	floats := make([]float64, n)
	for i := 0; i < n; i++ {
		floats[i] = io.ScanFloat64()
	}
	return floats
}

func (io *IO) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}


package main

import "fmt"

func main(){
	var N,M,X,Y int
	fmt.Scan(&N,&M,&X,&Y)
	x := make([]int,N)
	y := make([]int,M)
	for i:=0;i<N;i++{
		fmt.Scan(&x[i])
	}
	for i:=0;i<M;i++ {
		fmt.Scan(&y[i])
	}
	xmax := x[0]
	ymin := y[0]

	for i:=0;i<N;i++{
		if xmax < x[i]{
			xmax = x[i]
		}

	}

	for i:=0;i<M;i++{
		if ymin > y[i]{
			ymin = y[i]
		}
	}

	if xmax < ymin && X < xmax+1 && xmax+1 <= Y {
		fmt.Println("No War")
	}else {
		fmt.Println("War")
	}


package main

import "fmt"

func main(){
	var N,M,X,Y int
	fmt.Scan(&N,&M,&X,&Y)
	x := make([]int,N)
	y := make([]int,M)
	for i:=0;i<N;i++{
		fmt.Scan(&x[i])
	}
	for i:=0;i<M;i++ {
		fmt.Scan(&y[i])
	}
	xmax := x[0]
	ymin := y[0]

	for i:=0;i<N;i++{
		if xmax < x[i]{
			xmax = x[i]
		}

	}
	xmax++
	for i:=0;i<M;i++{
		if ymin > x[i]{
			ymin = x[i]
		}
	}

	if xmax < ymin && X < Y {
		fmt.Println("No War")
	}else {
		fmt.Println("War")
	}

}


_, _, x, y = gets.chomp.split.map(&:to_i)
xc = gets.chomp.split.map(&:to_i)
yc = gets.chomp.split.map(&:to_i)
xc << x
xc.sort!
yc << y
yc.sort!
puts (yc[0] - xc[-1] > 0)? "No War" : "War"


n,m,x,y = gets.split.map(&:to_i)
xwant = gets.split.map(&:to_i).sort
ywant = gets.split.map(&:to_i).sort
if xwant[-1] < ywant[0]
  hani = [*((xwant[-1] + 1)..ywant[0])]
  if (hani.size == 1 && x < hani[0] && y >= hani[0]) || hani.size >= 2
    puts "No War"
  else
    puts :War
  end
else
  puts :War
end


nmxy = gets.chomp.split
n = nmxy[0].to_i
m = nmxy[1].to_i
X = nmxy[2].to_i
Y = nmxy[3].to_i

x = gets.chomp.split
n.times do |i|
    x[i] = x[i].to_i
end

y = gets.chomp.split
m.times do |i|
    y[i] = y[i].to_i
end

war = true
((X + 1)..Y).each do |z|
    agreement = true
    n.times do |i|
        if x[i] >= z
            agreement = false
            break
        end
    end
    if agreement
        m.times do |i|
            if y[i] < z
                agreement = false
                break
            end
        end
    end
    if agreement
        war = false
        break
    end
end

puts war ? "War" : "No War"


n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (a.max+1-x>0 && y-a.max+1>=0)? 1:0
puts ans1+ans2>=2 ? "No War" :"War"


n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (ans1-x>0 && y-ans1>=0)? 1:0
puts ans1+ans2>=2 ? "No War" :"War"


n,m,x,y=gets.split.map &:to_i
a=gets.split.map &:to_i
b=gets.split.map &:to_i
ans1= b.min-(a.max+1)>=0? 1:0
ans2= (ans1-x>0 && y-ans1>=0)? 1:0
puts ans1+ans2>=1 ? "No War" :"War"


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::cmp::max;

fn main() {
    let n: usize = read();
    let m: usize = read();
    let x: i64 = read();
    let y: i64 = read();
    let mut xv: Vec<i64> = vec![x];
    let mut yv: Vec<i64> = vec![y];

    for _ in 0..n {
        xv.push(read());
    }

    for _ in 0..m {
        yv.push(read());
    }

    let maxv = xv.iter().max();
    let minv = yv.iter().min();

    if maxv < minv {
        println!("No War");
    } else {
        println!("War");
    }
}


#[allow(unused_macros, dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros, dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(dead_code)]
struct UnionFind {
    parent: Vec<usize>,
    rank: Vec<usize>,
    size: Vec<usize>,
}

#[allow(dead_code)]
impl UnionFind {
    fn new(n: usize) -> UnionFind {
        let mut p = vec![0; n];
        for i in 0..n {
            p[i] = i;
        }
        return UnionFind {
            parent: p,
            rank: vec![0; n],
            size: vec![1; n],
        };
    }

    fn find(&mut self, x: usize) -> usize {
        if x == self.parent[x] {
            x
        } else {
            let p = self.parent[x];
            let pr = self.find(p);
            self.parent[x] = pr;
            pr
        }
    }

    fn same(&mut self, a: usize, b: usize) -> bool {
        self.find(a) == self.find(b)
    }

    fn unite(&mut self, a: usize, b: usize) {
        let a_root = self.find(a);
        let b_root = self.find(b);
        if a_root == b_root {
            return;
        }
        if self.rank[a_root] > self.rank[b_root] {
            self.parent[b_root] = a_root;
            self.size[a_root] += self.size[b_root];
        } else {
            self.parent[a_root] = b_root;
            self.size[b_root] += self.size[a_root];
            if self.rank[a_root] == self.rank[b_root] {
                self.rank[b_root] += 1;
            }
        }
    }

    fn get_size(&mut self, x: usize) -> usize {
        let root = self.find(x);
        self.size[root]
    }
}

const MOD_P: usize = 1000000007;

#[allow(dead_code)]
// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % MOD_P;
    }
    acc
}

#[allow(dead_code)]
fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % MOD_P;
        }
        e /= 2;
        base = base * base % MOD_P;
    }

    if e == 1 {
        acc = acc * base % MOD_P;
    }

    acc
}

#[allow(dead_code)]
fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    fact(n) * mod_pow(fact(r), MOD_P - 2) % MOD_P * mod_pow(fact(n - r), MOD_P - 2) % MOD_P
}

#[allow(dead_code)]
fn gcd(a: usize, b: usize) -> usize {
    if b > a {
        gcd(b, a)
    } else if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

#[allow(dead_code)]
fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

use std::cmp::{max, min};

fn main() {
    input! {
        n: usize,
        m: usize,
        x: isize,
        y: isize,
        mut xs: [isize;n],
        mut ys: [isize;m],
    }
    xs.push(x);
    ys.push(y);
    let xmax = xs.iter().max();
    let ymin = ys.iter().min();
    let ans = if xmax < ymin { "No War" } else { "War" };
    println!("{}", ans);
}


use std::io::Read;

fn main() {
    let mut buf = String::new();

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let m: usize = iter.next().unwrap().parse().unwrap();
    let x: i32 = iter.next().unwrap().parse().unwrap();
    let y: i32 = iter.next().unwrap().parse().unwrap();
    let xs: Vec<i32> = (0..n).map(|_| iter.next().unwrap().parse().unwrap()).collect();
    let ys: Vec<i32> = (0..m).map(|_| iter.next().unwrap().parse().unwrap()).collect();
    let max_x = *xs.iter().max().unwrap();
    let min_y = *ys.iter().min().unwrap();

    let ans = std::cmp::max(max_x, x) < std::cmp::min(min_y, y);
    println!("{}", if ans { "No War" } else { "War" });

}


use proconio::{fastout, input};

#[fastout]
fn main() {
    input!(n: usize,m:usize,x:isize,y:isize,mut xn:[isize;n],mut ym:[isize;m]);

    xn.sort();
    ym.sort();

    let is_oc = if xn[xn.len() - 1] >= ym[0] {
        true
    } else {
        let count = (xn[xn.len() - 1]..ym[0])
            .filter(|&xxx| x < xxx && xxx <= y)
            .count();
        count == 0
    };

    println!("{}", if is_oc { "War" } else { "No War" });
}