Music
Babies and toddlers loved music, and Guslya was a talented musician. He owned a variety of musical instruments, which he often played. Since he had many instruments, he hung them on the walls of his room. The instrument located immediately to the right of the entrance door was labeled 1, and they were numbered sequentially in a circle, with the last instrument, labeled n, hanging to the left of the door.
The children frequently asked Guslya to teach them how to play an instrument. Guslya was always willing to help, but he had a unique method: he would first offer the instrument labeled 1. If the student wanted a different instrument, they would choose the sixth instrument in the circle from the current one, and so on. Your task is to write a program that determines the attempt number on which a student could obtain the desired instrument labeled k.
For example, if there are n = 11 instruments, the sequence would be: (1) 2 3 4 5 6 (7) 8 9 10 11 1 (2) 3 4 5 6 7 (8) 9 10 11 1 2 (3) 4 5 ..., meaning that for k = 3, the instrument labeled 3 would be available on the fifth attempt.
Input
Two natural numbers n and k (1 ≤ k ≤ n ≤ 100).
Output
Output the attempt number on which the instrument labeled k "appeared". If it never appears, output 0.