The cows have been sent on a mission through space to acquire a new
milking machine for their barn. They are flying through a cluster
of stars containing N (1
输入格式
Line 1: Two space-separated integers, N and K.
Lines 2..N+1: Line i+1 contains two space-separated integers, a_i
and b_i respectively, that are planet i's trading trading
products. The planet will give item b_i in order to receive
item a_i.
输出格式
Line 1: One more than the minimum number of trades to get the
milking machine which is item K (or -1 if the cows cannot
obtain item K).