Hmm, from your post it looks like you had no idea wtf you were doing and just miraculously came accross the correct answer you fag!
First of all here are the two rules we must look at:
[1] ancestor(X, Y):- parent(X, Y)
[2] ancestor(X, Z):- parent(X, Y), ancestor(Y, Z)
Now from the [1]...