def mul_xin(p, i, n):
 R = p.ring
 q = R(0)
 for (k, v) in p.items():
  k1 = list(k)
  k1[i] += n
  q[tuple(k1)] = v
 return q

def mul_xin ( p , i , n ) : R = p . ring q = R ( 0 ) for ( k , v ) in p . items ( ) : k1 = list ( k ) k1 [ i ] += n q [ tuple ( k1 ) ] = v return q
return p*x_i**n .