def ker(E, ell1, ell2):
P, Q, R = E.gens()
E1 = E.change_ring(GF(ell1))
E2 = E.change_ring(GF(ell2))
K = []
for a, b, c in GF(3)^3:
S = ZZ(a)*P + ZZ(b)*Q + ZZ(c)*R
S1 = E1(S)
if len(S1.division_points(3)) > 0:
S2 = E2(S)
if len(S2.division_points(3)) > 0:
K.append(S)
return K