////////////////////////////////////////////////////////////////////////////////////////////////////////
//Verifying r=4 case in Theorem 6.1

P<t>:=PolynomialRing(Rationals());

f4:=127358629188153017343112694654244*t^10-14476726558441542259500980593582900*t^9+767540949843094964859507359162484321*t^8-23227949011157855871750302161149318060*t^7+486933739385947419621206507920009537350*t^6-8471956828413213486742748322179256745500*t^5+139665528153448288531118705650287136663899*t^4-1509800364506319291441531124462079071041720*t^3+14597743197263467927181474503046907251979462*t^2-135004259433655686521826532061360904927910680*t+543592155691663960065241800360826161610140961;

C4:=HyperellipticCurve(P!f4);
F4<u,y>:=FunctionField(C4);

y41:=11285328049647162*u^5-612703879315493343*u^4+11259180860536474740*u^3+124175441794992816207*u^2-2894185136924624900028*u+23315023973129417008893;
y42:=11285328049647162*u^5-637837872300913137*u^4+15898504501345253760*u^3-133140352448943347487*u^2+2895345088136314829232*u-23315023973129417008893;
y43:=11285328049647162*u^5-641395912765696179*u^4+15779426445792454284*u^3-132367737077167916373*u^2+2891689893601551455028*u-23295069079544963156463;
y44:=11285328049647162*u^5-787772412770249571*u^4+14665379977955069244*u^3-219254957235699134757*u^2+2621647313739427449588*u-35358708563462647994607;
y45:=11285328049647162*u^5+2985212511317920527*u^4+74598289369102611840*u^3+1831498005344531215377*u^2+17007935571912588694272*u+183122730884960782522323;

D41:=(PrincipalDivisor(y-y41)-PrincipalDivisor(y-y45)) div 3;
D42:=(PrincipalDivisor(y-y42)-PrincipalDivisor(y-y45)) div 3;
D43:=(PrincipalDivisor(y-y43)-PrincipalDivisor(y-y45)) div 3;
D44:=(PrincipalDivisor(y-y44)-PrincipalDivisor(y-y45)) div 3;

IsPrincipal(3*D41);
IsPrincipal(3*D42);
IsPrincipal(3*D43);
IsPrincipal(3*D44);

for i1,i2,i3,i4 in [0..2] do
D:=i1*D41+i2*D42+i3*D43+i4*D44;
if IsPrincipal(D) then
i1,i2,i3,i4;
end if;
end for;