updated question to also print accepting states.