eolymp
bolt
Try our new interface for solving problems
Problems

Yoyu Nyerk

Yoyu Nyerk

Smon Jeet first came to Yoyu Nyerk. It is for this reason that he is poorly oriented in this huge city.

The construction of the city roads is quite simple. The roads of the city consist of n streets running from east to west, and m avenues, extending from north to south. All the streets are numbered from 1 to n, starting from the northernmost street. Similarly, starting from the westernmost, the avenues are numbered. All distances between neighboring streets and avenues are the same. All the streets and avenues are one-sided.

Smon has a map showing the directions of all the roads of the city. Smon knows that he is now at the intersection of a-th avenue and s-th street. He really wants to get on his car at the intersection b-th avenue and t-th street. Help him find the best route.

prb5505

A route is a description of the way in which Smon should move. This description consists of a set of integers ci, which means that from the first intersection to the first turn it is necessary to drive c1 quarters, then turn and go c2 quarters until the next turn and so on. The last number in the route description corresponds to the distance from the last turn to the end point of the path. The length of the route is the length of the path that corresponds to it. Smooth Jeet believes that short routes are better than long ones. Among the routes of the same length, Smon believes that routes with fewer turns are better. And among the routes of the same length and with the same number of turns, Smon considers better routes in which the minimum ci is the maximum. The remaining routes Smon considers equal.

Input

First line contains two integers n and m (1n, m1000) - number of streets and avenues in Yoyu Nyerk. Next line contains n integers, defining the streets direction. Number at the i-th position corresponds to the direction of the i-th street. Value 1 corresponds to the fact that the street is allowed to move from west to east, value -1 - from east to west. In the next line, the directions of the avenues are set in the same way, while 1 corresponds to the movement from north to south.

The last two lines contains two integers s, a and t, b correspondingly (1s, tn, 1a, bm). It is guaranteed that the starting and ending positions do not match.

Output

If you can not reach the end point, output the single word "Impossible". Otherwise, output the best route. In the first line output "Street", if the traffic at the beginning of the road should start along the street, or "Avenue", if on the avenue. In the second line output k - the number of numbers in the path description, and in the third line k integers - the description of the route. If there are several answers, output any.

Time limit 3 seconds
Memory limit 256 MiB
Input example #1
3 2
1 -1 -1
-1 1
3 1
3 2
Output example #1
Avenue
3
2 1 2
Input example #2
3 2
-1 -1 -1
-1 1
3 1
3 2
Output example #2
Impossible
Source 2011 Цикл Интернет-олимпиад для школьников, Восьмая индивидуальная олимпиада, March 27, Problem B