Thanks for the query to H.C.M. Forum.
Since it is very difficult to say the type of worm you passed in toilet may be .
ascaris or ankyloma duodenal ,Schistosoma mansoni .
In my opinion there are so many parasites so get in blood as well STOOL examination for ova & cyst
As it was present in the intestine and came out .
Pain in abdomen was due to this type worm infestation so consult a physician and get his opinion and treatment .
Good luck. Dr. HET