#P122. [KSC002D] 新的编程语言

[KSC002D] 新的编程语言

Source

This problem is adapted from Long Long OJ and proposed by . All rights reserved.

Problem Background

yangrenruiYRR was bored and created a new programming language.

Problem Description

The input provides a series of statements of the following types (xx is a variable name consisting of a lowercase letter, and yy is an integer):

  • define x y, sets xx to yy;
  • plus x y, changes xx to x+yx + y;
  • minus x y, changes xx to xyx - y;
  • times x y, changes xx to x×yx \times y;
  • divide x y, changes xx to xy\dfrac{x}{y};
  • out x, outputs xx.

The initial value of all variables is 00.

Input Format

  • Line 11: A positive integer nn;
  • Lines 22 to n+1n + 1: One statement per line.

Output Format

The output of the program defined by the input.

Samples

4
define a 31415
define b 92653
out a
out b
31415
92653

Data Range

Case nn Special Property
11 10\le10 None
242\sim4 104\le10^4
575\sim7 106\le10^6
88 A
99 B
1010 C

Special Properties:

  • A: Only one variable appears;
  • B: Only define and out operations are used;
  • C: All variable values during computation are 0\ge 0 and y0y \ge 0.

For 100%100\% of the data, 1n1061 \le n \le 10^6, 231y<231-2^{31} \le y < 2^{31}.

You only need to use int for calculations.