It is 3rd down and Team A (is on offense) needs to get to the 1st down marker. If Team A advances the ball 6 yards beyond the 1st down marker AND FLAG GUARDS at that exact spot-Ref throws his flag. Team B (defense) tries to strip the ball from Team A's ball carrier further down the field and the Ref throws his "HAT" on the field because he already threw his flag on the flag guard.
1.) Are these penalties offsetting?
2.) Is this a 1st down minus the 10 yard for flag guarding?
3.) Is this 4th down and 4 yards to go to the 1st down marker?
4.) Or another outcome?