#include <iostream>
#include <math.h>
using namespace std;

int main() {

    long N;

    cin >> N;

    // N = A * B
    // B = N / A
    
    // A , B 桁数大きい方の、最小値
    long ans = 100000000;

    double d = sqrt(N) + 1;
    //cout << "d: " << d << endl;

    for (long i = 1; i < d ; i++) {
        long a = i;

        //整数チェック
        if (N % a != 0){
            continue;
        }
        long b = N / a;

        //cout << "a: " << a << "   b: " << b << endl;
        string s_a = to_string(a);
        int k_a = s_a.size();
        string s_b = to_string(b);
        int k_b = s_b.size();

        int m = max(k_a, k_b);

        if (ans > m){
            ans = m;
        }
    }

    cout << ans << endl;

    return 0;

}
#include <bits/stdc++.h>
using namespace std;
void chmax(int& a, int b) {
  if (a < b) a = b;
}

void chmin(int& a, int b) {
  if (a > b) a = b;
}
  
int main () {
  int N, M, X, Y;
  cin >> N >> M >> X >> Y;
  
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    chmax(X, x);
  }
  for (int i = 0; i < M; i++) {
    int y;
    cin >> y;
    chmin(Y, y);
  }
  
  if (X < Y) {
    cout << "No War" << endl;
  } else {
    cout << "War" << endl;
  }
}