Hi and welcome to HCM..
Thank you for posting your query and I'm here to answer your question..
I read your question completely and have understood it well enough..
As a surgeon we come across such cases where the paternity is a question mark..
Well, but you have given a brilliant history and because of which I can say with certainty that the guy B is responsible for the
pregnancy and not guy A.
I would like you to know these following facts..
1. Ovulation generally occurs around 14th day of normal 28 to 30 day cycle..
2. So, after periods, generally again on 14th day you ovulate..
And any sexual encounter during these days will result in pregnancy..
Going by your case..
1. You had sex with Guy A and had periods 2 days later.
31 August.. So your ovulation for August will definitely be somewhere around 17th or 18th.
2. Next ovulation will be around September 13,14.
During these days you had sex with Guy B.
This is perfect and classical scenario.
Hope I have cleared your doubts, in case you still need any further assistance let me know..
Take care and God bless..