Formulaic expressions#10233

Formulaic expressions

1 second
64 megabytes
Easy

You have a table with rows and columns. The rows are numbered from to , and the columns are labeled with the letters through .

Each cell in the table is identified by a combination of a column letter and a row number (for example, refers to the cell in column and row ).

The expression consists of mathematical operations and/or applied to these cells. The expressions are guaranteed to be correctly formatted and contain no spaces.

Input

The first line contains the integers and .

The next lines each contain numbers, representing the table's contents.

The final line contains the expression to be evaluated.

Output

The result of the evaluated expression.

Examples

Example 1

Loading
Loading