Parse a Baseball Pitch String Take an arbitrarily sized string as input. This string represents a baseball plate appearance, in which each character represents a pitch as follows:


Strike: S
Ball: B
Foul ball: F
Hit by pitch: H
Ball in play: X


(For those wondering, this is a very very simplified version of Retrosheet's notation)



Your program must output 1 of 3 possible outputs to signify 1 of the mutually exclusive outcomes:


Strikeout
Walk
Ball in play


It doesn't matter what the outputs are exactly, as long as they are guaranteed to be distinct.



For those unfamiliar with the rules of baseball:


3 strikes results in a strikeout
4 balls results in a walk
A foul ball is a strike UNLESS the batter already has 2 strikes, in that case nothing happens
Hit by pitch immediately results in a walk
"Ball in play" immediately results in the "Ball in play" outcome




You may assume that:


the input string is encoded as ASCII
the input string represents an entire plate appearance (in other words it will end in one of the 3 outcomes above)
there are no other characters other than the ones above


You may not assume that:


there are no extra pitches/characters after the plate appearance is supposed to legally end
your program must return on the last pitch/character




Examples:

"Strikeout"fy:

SSS
SBSBS
BBBSSS
BSBSBS
BSFFBFS
BBSSFFFFFFFFS
SSSBBBB
FSS


"Walk"y:

BBBFB
BBBB
BBBSB
SSBBBB
SSH
SBSFFBFFFFBFFFFFFFFB
BBBBSSS
HSSS
SBBBBSS


"Ball in play"ly:

X
SSX
BBBX
SBSX
FFFFFFFFFFFFFFX
XBSBSBSB




This is code-golf, so fewest bytes wins.

(This challenge was inspired by this YouTube video)
Retina 0.8.2, 22 bytes

4=`B
H
2`F|S

1!`[XHS]


Try it online! Link includes test cases. Outputs X for ball in play, H for walk, and S for strikeout. Explanation:

4=`B
H


The fourth ball results in a walk, same as hit by pitch.

2`F|S


The first two foul balls/strikes are ignored.

1!`[XHS]


Take the first available result.