1.

/**
* ACM Training 2009
* ACM Problem #11629 - Ballot evaluation
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2676
* @author Miesel Christoph
* @author Evgeni Pavlidis
* @version 1.0 11.08.2009
*
* Status : Accepted
* Runtime: 0.788
*/

import java.util.*;

public class Ballot
{
private static HashMap<String, Integer> area = new HashMap<String, Integer>();

public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
sc.useLocale(Locale.ENGLISH);
int parties, guesses;
parties = sc.nextInt();
guesses = sc.nextInt();
int sum;
String temp = null;
StringBuilder sb = new StringBuilder();

for(int i = 0; i < parties; i++)
{
area.put(sc.next(), (int)(sc.nextDouble()*10));
}

for(int i = 1; i <= guesses; i++)
{
sb.append("Guess #"+i+" was ");
sum = area.get(sc.next());
while((temp = sc.next()).hashCode() == "+".hashCode())
{
sum += area.get(sc.next());
}

if(temp.hashCode() == "<".hashCode())
{
sb.append(sum < (sc.nextInt()*10) ? "correct.\n" : "incorrect.\n");
}
else if(temp.hashCode() == ">".hashCode())
{

sb.append(sum > (sc.nextInt()*10) ? "correct.\n" : "incorrect.\n");
}
else if(temp.hashCode() == "<=".hashCode())
{

sb.append(sum <= (sc.nextInt()*10) ? "correct.\n" : "incorrect.\n");
}
else if(temp.hashCode() == ">=".hashCode())
{

sb.append(sum >= (sc.nextInt()*10) ? "correct.\n" : "incorrect.\n");
}
else if(temp.hashCode() == "=".hashCode())
{

sb.append(sum == (sc.nextInt()*10) ? "correct.\n" : "incorrect.\n");
}

}
System.out.print(sb);
}
}