Step a= the value is 2, 13, 26, and the number of steps at this time is 14m, 3m, 2m respectively.
Take a step. B= the values are 2, 3 and 6. At this time, step 4 meters, 3 meters and 2 meters respectively.
I see, at least one solution is obtained: when a = 13 and b=2, A and B take one step each.