import java.io.BufferedReader;
	import java.io.IOException;
	import java.io.InputStreamReader;

	public class Main {
		public static void main(String[] args) {
			try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
				String s = "";
				while ((s = br.readLine()) != null) {
					Operation o;
					try {
						o = new Operation(s);
						int result = getResult(o);
						System.out.printf("%d %c %d = %d\n", o.getOpOne(), o.getOp(), o.getOpTwo(), result);
					} catch (NumberFormatException | OperationConstructionException | DivideException e) {
						e.printStackTrace();
					}
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		private static int getResult(Operation o) throws DivideException {
			switch (o.getOp()) {
			case '+':
				return o.getOpOne() + o.getOpTwo();
			case '-':
				return o.getOpOne() + -o.getOpTwo();
			case '*':
				return multiply(o.getOpOne(), o.getOpTwo());
			case '/':
				return divide(o.getOpOne(), o.getOpTwo());
			case '^':
				return power(o.getOpOne(), o.getOpTwo());
			case '%':
				break;
			default:
				System.err.printf("%c is not a supported operation.\n", o.getOp());
				return -1;
			}
			return -1;
		}
	
		private static int power(int one, int two) throws DivideException {
			if (two == 0) {
				return 1;
			} else if (two < 0) {
				throw new DivideException("Non-Integral Answer");
			}
			int result = 1;
			for (int i = 0; i < two; i++) {
				result = multiply(result, one);
			}
			return result;
		}
	
		private static int divide(int one, int two) throws DivideException {
			if (two == 0) {
				throw new DivideException("Cannot divide by 0.");
			}
			boolean answerNegative = false;
			if ((one < 0 && two > 0) || (one > 0 && two < 0)) {
				answerNegative = true;
				if (one < 0) {
					one = -one;
				}
				if (two < 0) {
					two = -two;
				}
			} else if (one < 0 && two < 0) {
				one = -one;
				two = -two;
			}
		
			int count = 0;
			int rem = one;
			while (rem >= two) {
				rem = rem + -two;
				count++;
			}
			if (rem > 0) {
				throw new DivideException("Non-Integral Answer");
			}
			return answerNegative ? -count : count;
		}

		private static int multiply(int one, int two) {
			boolean answerNegative = false;
			if ((one < 0 && two > 0) || (one > 0 && two < 0)) {
				answerNegative = true;
				if (one < 0) {
					one = -one;
				}
				if (two < 0) {
					two = -two;
				}
			} else if (one < 0 && two < 0) {
				one = -one;
				two = -two;
			}
			int result = 0;
			for (int i = 0; i < one; i++) {
				result += two;
			}
			return answerNegative ? -result : result;
		}

		public static class Operation {
			private int op_one, op_two;
			private char op;

			public Operation(String s) throws OperationConstructionException, NumberFormatException {
				String[] parts = s.split("\\s");
				if (parts.length != 3) {
					throw new OperationConstructionException("Input must contain 3, spaced, items.");
				}
				op_one = Integer.parseInt(parts[0]);
				op_two = Integer.parseInt(parts[2]);
				if (parts[1].length() != 1) {
					throw new OperationConstructionException("Operation must be a single char: +, -, /, *, ^, %");
				}
				op = parts[1].charAt(0);
			}

			public int getOpOne() {
				return op_one;
			}

			public int getOpTwo() {
				return op_two;
			}

			public char getOp() {
				return op;
			}
		}

		public static class OperationConstructionException extends Throwable {
			private static final long serialVersionUID = 1L;

			public OperationConstructionException(String message) {
				super(message);
			}
		}
	
		public static class DivideException extends Throwable {
			private static final long serialVersionUID = 1L;
		
			public DivideException(String message) {
				super(message);
			}
		}
	}