#000020

fensi

An array is fancy if the sum of every two adjacent numbers is not a prime number. A prime number is only divisible by 1 and itself. You are given the interval of natural numbers from N to M which contains the numbers N, N+1, N+2, ..., M-1, M. You need to find a permutation of the given array that represents a fancy array. A permutation of an array is an array that contains the same elements but in an arbitrary arrangement.


InputThe first and only line of the standard input contains two integers separated by one space: N and M (1<=N<M<=30000).

OutputTo the standard output write any permutation of numbers N, N+1, N+2, ..., M-1, M so that the sum of adjacent numbers is a composite number (not prime). Each number should occupy one line. If there is no solution, write 0.

Input:
3 8
Output:
4
5
7
3
6
8

Explanation: The sums of adjacent numbers in the array are: 4 + 5 = 9, 5 + 7 = 12, 7 + 3 = 10, 3 + 6 = 9, 6 + 8 = 14 and none of them is prime.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.