find_case(p,A,B,C,D,E,F) = {

f = (A*X_0^2 + B*X_0*X_1 + C*X_0*X_2 + D*X_1^2 + E*X_1*X_2 + F*X_2^2)*Mod(1,p);
M = [0];

for(i=0, p-1,
  for(l=0, p-1,
    if(i*l %p == A,
      for(k=0, p-1,
        for(n=0, p-1, 
          if(k*n %p == F,
            for(m=0, p-1,
              for(j=0, p-1,
                if(m*j %p == D, 
                  if( (i*X_0 + j*X_1 + k*X_2)*(l*X_0 + m*X_1 + n*X_2)*Mod(1,p) == f,
                    M = [i,j,k;l,m,n]
                  )
                )
              )
            )
          )
        )
      )
    )
  )
);

if(length(M) == 1,
  return("Intersects every line in 0, 1, or 2 points"),
    for(a = 1, p - 1,
      if(a*M[1,] == M[2,], return("Is a double-line"))
    );
  return("Is the union of two lines")
)
}