P, Q = map(int, input().split()) LR=P/Q minRL = 1000000 L = 0 R = 0 qL, pL, pR, qR = 0, 0, 0, 0 minR = 100000 maxL = 0 for p in range(1, 10): for q in range(1, Q): R = p/q L = p/q if L>maxL and L<(P/Q): maxL = L pL, qL= p, q if R