Finding the transition id based on the input