import java.io.*;
import java.util.*;

public class Calculator {

    public static void inputLoop () throws IOException {
	BufferedReader stdin =
	    new BufferedReader (new InputStreamReader (System.in));
	
	while (true) {
	    System.out.print ("=>");
	    String postfix = stdin.readLine();
	    if (postfix == null) break;
	    if (postfix.equals ("quit")) break;
	    
	    Evaluator e = new Evaluator (postfix);
	    int res = e.evaluate ();
	    System.out.println (res);
	}
    }
    
    public static void main (String[] args) throws IOException {
	inputLoop ();
    }
}

