using System;
using System.Collections.Generic;
using System.IO;
class SpellChecker {
static void Main(string[] args) {
FileStream fs_dict = new FileStream(args[0], FileMode.Open, FileAccess.Read),
fs_in = new FileStream(args[1], FileMode.Open, FileAccess.Read),
fs_out = new FileStream(args[2], FileMode.Create, FileAccess.Write);
StreamReader sr_dict = new StreamReader(fs_dict);
HashSet <string> dict = new HashSet <string>;
while ((string word = sr_dict.ReadLine()) != null)
dict.Add(word);
sr_dict.Close();
StreamReader sr_in = new StreamReader(fs_in);
StreamWriter sw_out = new StreamReader(fs_out);
bool flag = false;
while ((string line = sr_dict.ReadLine()) != null)
{
string[] words = line.Split(new Char[] {' ', ',', '.', '-'});
for (int i = 0; i < words.Length; ++i)
if (words[i] != "" && !dict.Contains(words[i]))
{
sw_out.WriteLine(words[i]);
flag = true;
}
}
sr_in.Close();
sw_out.Close()
if (flag)
Console.WriteLine("WARNING");
else
Console.WriteLine("OK");
}
}