If you did ovulate later than, for example, the 4th or 5th, it clarifies things a lot. I'm glad you are going in next week also. Be sure to ask them for an estimated due date at that time.
When you say that Guy B "withdrew twice," it sounds like you're saying you began, and he pulled out and ejaculated, and presumably after a bit of recovery he got an erection again and you continued, and he pulled out again. If this is the case, there is no protection from pregnancy with Guy B, because his urethra would have had loads of sperm in it from the first ejaculation, and the sperm would have ridden into your body on pre-ejaculatory fluid from the second erection. In short, he may as well have not bothered to pull out for all the good it did. (Even the first time, he could have had sperm in his urethra if he had happened to have had an ejaculation before seeing you.)
Sperm can live 4-6 days in your reproductive tract; some reaearch suggests 3-4 days, some suggests 4-5 days, and some suggests up to 7 days, (though I've also seen some that asserts that after 6 days it is no longer mighty enough to penetrate the egg). This gives you plenty of possibility that sperm from the guy on the 27th could have been alive in the range of time when you might have ovulated.
You can't be sure when you ovulated from when your period came, either. The period is not the beginning of the cycle, it's the end. Ovulation is the start point, and two weeks later a period comes (except when the woman has gotten pregnant). Then the next ovulation is whenever the body feels like it. Women whose cycles are not like clockwork for months and months (such that she knows exactly on day 28 or day 32 the next period will come) really only can determine when they ovulated by counting back from a period 14-15 days, and all that tells them is when they ovulated before the period came. The next ovulation will never be predicted by the last period unless, like I said, someone's body is so exact and predictable that she can set her watch by the day her period comes and it is always exactly the same day of the cycle.
Anyway, you're in the position where you need to get an ultrasound in your 6th or 7th week (a count that you begin on the first day of your last period). That means, this week. See your ob-gyn and tell him you don't know for sure when your period came, so he or she won't just give you a date based on your last period, and get that ultrasound. When they give you a number of weeks based on the size of the embryo, also be sure they give you an estimated due date, and you can take that home and put it into a pregnancy calculator online or just count back on a calendar 266 days for an estimated conception date. It might not help, since the dates of the two guys are so intertwined, but if you are lucky it will indicate that the pregnancy began too late to be the guy on the 27th.
If you can't get an ultrasound, your only other way to know before the baby comes and you do a DNA test, is to do a prenatal DNA test. These are not done by women too often, because they are very costly. But if you can afford it, do it with both men. (In a sane world, the men would split the cost with you and it would be more affordable, but I've never heard of men being willing to.) Don't use a cheapie lab that advertises on the Internet, use either Ravgen or the DDC. And test with both men.
If you don't go that route, your only remaining option is a DNA test after the baby comes. Again, test with both men. If either man is balky, a lawyer is your friend. They don't have the right to try to weasel out of a paternity test, judges do not smile upon guys who try.
Good luck, you could also read the list at the top of this forum for more information about the order in which to take steps to try to decide who the dad is.