jiahuimbzuai/CoQuIR huggingface dataset:
//  [java]
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());
        }
    }

}
//  [java]
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;
    }
}
//  [java]
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());
    }
}
//  [java]
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();
	}

}
//  [java]
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);
        }
    }
}
//  [java]
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();
	}
};
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [cpp]
#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;
	}
}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [javascript]
'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'));
//  [javascript]
/*
-------関数一覧--------
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;
}
//  [javascript]
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'));
//  [javascript]
/*
-------関数一覧--------
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;
}
//  [javascript]
/*
-------関数一覧--------
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;
}
//  [javascript]
// 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"));
//  [go]
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)
	}
}
//  [go]
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)
  }
}
//  [go]
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])
    }   
}
~
//  [go]
ｍ
//  [ruby]
r, d, x = gets.chomp.split.map(&:to_i)
10.times do
  x = r * x - d
  puts x
end
//  [ruby]
r, d, x = gets.split.map(&:to_i)

10.times do
  x = r * x - d
  puts x
end
//  [ruby]
#
# 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
//  [ruby]
r,d,x=gets.split.map(&:to_i)
i=0
while i<11
    x=r*x-d
    puts x
    i+=1
end
//  [ruby]
r,d,x=gets.split.map(&:to_i)
while i<11
    i=0
    x=rx-d
    puts x
    i+=1
end
//  [ruby]
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
//  [rust]
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);
    }

}
//  [rust]
#[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;
        
    }
}
//  [rust]
// 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);
    }
    
}
//  [rust]
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);
    }
}
//  [rust]
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
}
//  [rust]
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)
    }
}
//  [swift]
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 )
}
//  [swift]
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)
}
//  [swift]
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
}
//  [swift]
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)
}
//  [typescript]
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"));
//  [typescript]
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();
}
//  [typescript]
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"));
//  [typescript]
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"));
//  [typescript]
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"));
//  [python]
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)
//  [python]
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")
//  [python]
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")
//  [python]
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')
//  [python]
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)
//  [python]
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")
//  [java]
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());}
}
//  [java]
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");
	}

}
//  [java]
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");
		}
	}

}
//  [java]
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");
		}
	}

}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [cpp]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [c]
#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;
}
//  [javascript]
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')
}
//  [javascript]
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'));
//  [javascript]
// 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"));
//  [javascript]
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"))
//  [javascript]
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");
}
//  [javascript]
/*
-------関数一覧--------
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)
}
//  [go]
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()
}