def gf_rshift(f, n, K):
 if (not n):
  return (f, [])
 else:
  return (f[:(- n)], f[(- n):])

def gf_rshift ( f , n , K ) : if ( not n ) : return ( f , [ ] ) else : return ( f [ : ( - n ) ] , f [ ( - n ) : ] )
efficiently divide f by x**n .