Perfect Crime

Find the fewest moves to go from building S to D, where each move jumps F forward or B backward, avoiding police buildings.

Medium4BFSGraphNo attempts yetTime limit1sMemory limit512 MB

Problem

A new game has arrived at an arcade near Hongik University. You play the master thief X of Mapo-gu, who has just robbed a jewelry store, and you clear the game by getting X home without being seen by anyone. The game uses only two buttons, left and right, and follows these rules.

  1. All buildings in Mapo-gu stand in a single row and are numbered from 11 to NN. Mapo-gu has KK police stations, and the police already know X's face.
  2. When the game starts, X has just finished the robbery and is inside the jewelry store SS.
  3. X has built a secret passage out of Mapo-gu inside his home DD. So he must get home safely without being caught by the police.
  4. Pressing the left (←) button makes X run backward, and pressing the right (→) button makes him run forward. X can move only within Mapo-gu. He blindly trusts the way of moving he worked out after long research and moves only that way.
  5. X runs so fast that nobody can see his face. If X is currently inside building aa, he can come out and run forward into building a+Fa+F, or run backward into building aBa-B. However, he runs so fast that even he cannot stop partway.
  6. After each run X is exhausted and must rest for 10 seconds inside the building he reached. If he rests inside a police station, he is arrested and never gets home.

The game is still in beta, so it has bugs where there is no way to get home safely.

Jiun's hobby is clearing arcade games faster than anyone else. So among all the ways X can reach home safely, Jiun wants the smallest number of left and right button presses.

You are given the number of buildings NN, the robbed jewelry store SS, X's home DD, the number of buildings FF covered by one forward run, the number of buildings BB covered by one backward run, the number of police stations KK, and the building numbers of the police stations l1,l2,,lKl_1, l_2, \ldots, l_K. Write a program that prints the minimum number of button presses X needs to reach home safely.

If you find a case with no way home, print BUG FOUND so the data can be reported to the game company.

Input

The first line contains NN, SS, DD, FF, BB, and KK. If K>0K > 0, the second line contains the police station positions l1,l2,,lKl_1, l_2, \ldots, l_K.

  • 1S,DN1000001 \le S, D \le N \le 100\,000
  • 0F,B1000000 \le F, B \le 100\,000
  • 0KN/20 \le K \le N/2
  • SDS \ne D, and neither SS nor DD is a police station.

Output

Print on the first line the minimum number of button presses Jiun needs so that X gets from building SS to his home DD safely. If DD cannot be reached, print BUG FOUND.