import sys; sys.path.insert(0,'.')
from fibres import *
# Phi_d(D, lam) = D + 2*dim g_d(D,lam) - (4a+2b-3d); report max and zero set
bad=[]
for d in range(0,6):
    for a in range(0,6):
        for b in range(0,a+1):
            Z=[]; mx=None
            for D in range(d%2, 30, 2):
                p=g(d,D,(a,b),40)
                if not p: continue
                Phi = D + 2*deg(p) - (4*a+2*b-3*d)
                mx = Phi if mx is None else max(mx,Phi)
                if Phi==0: Z.append((D,lead(p)))
                if Phi>0: bad.append((d,a,b,D,Phi))
            if d<=3 and a<=3: print(f"d={d} lam=({a},{b}) maxPhi={mx} zeros(D,lead)={Z}")
print("positive Phi:", bad[:10])
