{"raw_statement":[{"iden":"statement","content":"The author of this problem hopes that you already know the pig called Benny.\n\nRecently she started learning numbers. The first type of numbers she has learnt are primes, i.e. positive integers with exactly two divisors. First few primes are 2, 3, 5, 7 and 11.\n\nAs a homework Benny was given two primes a and b. She has to transform a into b using addition and subtraction.\n\nSince Benny knows only primes, she might add and subtract only primes. Moreover, all the partial results also have to be primes.\n\nOne move is either adding or subtracting a prime to/from the current number. A way of transforming a into b is called _optimal_ if it doesn't use more moves than any other way. Your task is to find the only optimal way, if exactly one exists.\n\nIf it's impossible to transform a into b, print _\"Unlucky Benny\"_ (without the quotes). If there are multiple optimal ways, print _\"Poor Benny\"_ (without the quotes). Otherwise output the transformation with all partial results. See the output format below.\n\nThe only line of the input contains two integers a and b (2 ≤ a < b ≤ 1015). Both a and b are primes.\n\nIf the transformation is impossible, print _\"Unlucky Benny\"_.\n\nIf there are many optimal ways, print _\"Poor Benny\"_.\n\nIf there is exactly one optimal way to transform a into b, describe the process in the following format. Let x1, x2, ..., xk denote values of Benny's number in the order. So x1 = a, xk = b and Benny changes xi to xi + 1 in the i-th move. In a single line print k numbers separated with two characters _\"->\"_, without the quotes and spaces.\n\nOne move is enough in the sample.\n\nIf the only optimal way was to change 5 to 20, then change 20 to 10, and then finally change 10 to 7, the output would be _5->20->10->7_. Though, such a way is not only non-optimal but also it isn't valid. In the first move (from 5 to 20) we try to add 15 what is not prime. Also, a new number 20 isn't prime. This note is only to show you the correct format.\n\n"},{"iden":"input","content":"The only line of the input contains two integers a and b (2 ≤ a < b ≤ 1015). Both a and b are primes."},{"iden":"output","content":"If the transformation is impossible, print _\"Unlucky Benny\"_.If there are many optimal ways, print _\"Poor Benny\"_.If there is exactly one optimal way to transform a into b, describe the process in the following format. Let x1, x2, ..., xk denote values of Benny's number in the order. So x1 = a, xk = b and Benny changes xi to xi + 1 in the i-th move. In a single line print k numbers separated with two characters _\"->\"_, without the quotes and spaces."},{"iden":"note","content":"One move is enough in the sample.If the only optimal way was to change 5 to 20, then change 20 to 10, and then finally change 10 to 7, the output would be _5->20->10->7_. Though, such a way is not only non-optimal but also it isn't valid. In the first move (from 5 to 20) we try to add 15 what is not prime. Also, a new number 20 isn't prime. This note is only to show you the correct format."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ a, b \\in \\mathbb{P} $ with $ 2 \\leq a < b \\leq 10^{15} $, where $ \\mathbb{P} $ is the set of prime numbers.  \n\n**Constraints**  \n1. All intermediate values in the transformation sequence must be prime.  \n2. Each move consists of adding or subtracting a prime number (from $ \\mathbb{P} $).  \n3. The sequence $ x_1, x_2, \\dots, x_k $ must satisfy:  \n   - $ x_1 = a $,  \n   - $ x_k = b $,  \n   - For each $ i \\in \\{1, \\dots, k-1\\} $, $ x_{i+1} = x_i \\pm p $ for some $ p \\in \\mathbb{P} $,  \n   - $ x_i \\in \\mathbb{P} $ for all $ i \\in \\{1, \\dots, k\\} $.  \n\n**Objective**  \nFind the minimal number of moves $ k-1 $ to transform $ a $ into $ b $.  \n- If no such sequence exists: output `\"Unlucky Benny\"`.  \n- If multiple minimal-length sequences exist: output `\"Poor Benny\"`.  \n- If exactly one minimal-length sequence exists: output the sequence as $ x_1 \\rightarrow x_2 \\rightarrow \\cdots \\rightarrow x_k $.","simple_statement":"Given two primes a and b (a < b), transform a into b by adding or subtracting only prime numbers, where every intermediate result must also be prime. Find the minimal number of moves. If impossible, print \"Unlucky Benny\". If multiple minimal ways exist, print \"Poor Benny\". If exactly one minimal way exists, print the sequence of numbers using \"->\" between them.","has_page_source":false}