1. 
/**
* Angewandte Mathematik, SS11
* Problem: 465 Overflow
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=6&page=show_problem&problem=406
*
* @author Fabian Trampusch
* @author Robert Schwarz
* @version 1.0, 16.04.2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.116
*/
import java.io.*;
import java.math.BigInteger;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BigInteger maxInt = new BigInteger(Integer.toString(Integer.MAX_VALUE));

BigInteger firstNum, secondNum;
boolean firstNumTooBig, secondNumTooBig, resultTooBig;
char operator;

String line;
String[] input;

try {
while (true) {
line = br.readLine();
input = line.replaceAll(" ", "").split("(\\*|\\+)");
firstNum = new BigInteger(input[0]);
secondNum = new BigInteger(input[1]);
operator = line.contains("*") ? '*' : '+';

firstNumTooBig = firstNum.compareTo(maxInt) > 0;
secondNumTooBig = secondNum.compareTo(maxInt) > 0;

if (operator == '+') {
resultTooBig = firstNum.add(secondNum).compareTo(maxInt) > 0;
} else {
resultTooBig = firstNum.multiply(secondNum).compareTo(maxInt) > 0;
}

System.out.println(line);

if (firstNumTooBig) {
System.out.println("first number too big");
}

if (secondNumTooBig) {
System.out.println("second number too big");
}

if (resultTooBig) {
System.out.println("result too big");
}
}
} catch (Exception e) {

}
}
}