Build a terminal-based spreadsheet engine that can parse basic cell coordinates and evaluate simple arithmetic formulas.
Implement spreadsheet_engine(commands), where commands are strings: SET <cell> <expression> stores an integer or formula, and GET <cell> evaluates it. Formulas support integer literals, cell references such as A1 and AA10, parentheses, unary signs, and +, -, *, /; division truncates toward zero. Return one value per GET, using the string "ERROR" for missing cells, invalid expressions, division by zero, or circular references.
Input is a list of command strings. SET updates a cell, and later GET commands observe the latest definitions.
def spreadsheet_engine(commands):