public static void main(String[] args) {
		Stack<String> opts = new Stack<String>();
		Stack<String> vals = new Stack<String>();
		while (!StdIn.isEmpty()) {
			String temp = StdIn.readString();
			if (temp.equals("+") || temp.equals("-") || temp.equals("*")) {
				opts.push(temp);
			} else if (temp.equals(")")) {
				String val1 = vals.pop();
				String val2 = vals.pop();
				String opt = opts.pop();
				String val = "(" + val2 + opt + val1 + ")";
				vals.push(val);
			} else {
				vals.push(temp);
			}
		}

		StdOut.print(vals);
	}