In a running competition, the runway is a circle, where the athlete needs to run for
ncircles to complete the run. Every 100 meters the athlete runs, he gets a letter (A - Z), so when completing a full circle, the athlete collects a whole string of letters.
There are 3 athletes that need to run in the competition and all of them need to run on different tracks, and therefore for different numbers of circles. We have been told what strings each athlete will collect after running a single circle, and we know how many circles each athlete will need to complete the run.
Our task is to print the number of the athlete that will run the shortest distance.
The input consists of 6 lines. Each pair of lines contains a string which is the letter the athlete collects when making a whole circle and a number which is the number of circles the athlete needs to make to complete the race.
Print the number of the athlete who will run the shortest distance (1, 2, or 3).
SHORT 30 VERYVERYLONGLONGRUNBUTONCE 1 SHORTSHORT 2
After the run, the athletes would have collected the following strings:
So, the shortest one is the third.