scoreboard players add gamemode b 1
execute if score gamemode b matches 1 run gamemode a @a
execute if score gamemode b matches 2 run gamemode c @a

execute unless score gamemode b matches 1..2 run scoreboard players set gamemode b 0
