while~0: _=raw_input().split(";") for __ in _*4: try:exec __ except:0 print eval(_[-1])