1start: q0;2accept: q5;34# Remove one zero from left hand side of the operation.5# If at operation symbol: terminate.6q0 {7 0 > X => q1;8 P | P => q5;9}1011# Go to the right hand side of the operation.12q1 {13 0 > 0 => q1;14 P > P => q2;15}1617# Add a zero to the right hand side of the operation.18q2 {19 0 > 0 => q2;20 $ < 0 => q3;21}2223# Go to the left hand side of the operation.24q3 {25 0 < 0 => q3;26 P < P => q4;27}2829# Find the first non-X character.30# If none: stay add operation symbol.31q4 {32 0 < 0 => q4;33 X > X => q0;34}3536# Cleanup, remove X and P characters.37q5 {38 X < $ => q5;39 P < $ => q5;40}