def p_powl_VAL(p): '_powl : VAL' p[0] = p[1] write_list(inv_addmod(p[1]))
def p_powr_UNARY_MINUS(p): '_powr : SUB _powr %prec UNARY_MINUS' global MOD_G p[0] = -p[2] top: int = pop() write_list(inv_addmod(-top, mod=MOD_G - 1))
def p_umin_VAL(p): '_umin : VAL' p[0] = p[1] write_list(inv_addmod(-p[1]))
def p_powr_VAL(p): '_powr : VAL' global MOD_G p[0] = p[1] write_list(inv_addmod(p[1], mod=MOD_G - 1))
def p_expr_VAL(p): 'expr : VAL' p[0] = p[1] write_list(inv_addmod(p[1]))