Under construction

Still being built. Things may change

Honest Bureaucracy

Interview

Time limit1sMemory limit1024 MB

Summary
Split at most K coins so the favorite with the smallest weight gets as many as possible, with strictly larger weights receiving strictly more.
Level

Medium6 of 10

Topics
Binary search, Sorting, Greedy
Solved
No attempts yet

Statement

"It's called bureaucracy."

"Bureaucracy?"

"Yes. Every problem is solved by filling in forms, and a special breed of people called officials reviews them."

***

S. Lukyanenko, Nedotyopa

After the law taxing buildings above two floors was drafted, NN officials of King Markel the Merry had KK gold coins left in the budget. They decided to divide the money among themselves. Since only honest officials serve the King, they divide it fairly. Official ii contributed wiw_i to the bill. If official ii receives cic_i coins and official jj receives cjc_j coins, then ci<cjc_i < c_j holds if and only if wi<wjw_i < w_j. In particular, officials with equal contributions must receive equal amounts.

Some officials are the King's favorites. King Markel wants the favorite with the smallest contribution to end up with as much money as possible. The task does not require maximizing the earnings of officials who are not favorites.

Input

The first line contains a positive integer NN and two non-negative integers MM and KK, separated by spaces: the number of officials, the number of favorites, and the number of coins to divide (M≤N≤105M \le N \le 10^5, K≤1018K \le 10^{18}). The second line contains NN positive integers wiw_i (1≤wi≤1091 \le w_i \le 10^9), where wiw_i is the contribution of official ii. The third line contains MM distinct positive integers fif_i (1≤fi≤N1 \le f_i \le N), the numbers of the favorites.

Output

If a fair division exists, print POSSIBLE on the first line. On the second line, print NN non-negative integers separated by spaces, where the ii-th is the number of coins official ii receives. You do not have to distribute all coins. King Markel only cares that the favorite with the smallest contribution receives as many coins as possible, and other officials may split the rest however they like. Any correct answer is accepted. If a fair division is impossible, print IMPOSSIBLE.

Hint

Some coins may remain undistributed. In the first example, the leftover coins could also go to the second and fifth officials, but since they are not favorites, that is not required. In the second example, a correct division needs at least 4 coins, but only 3 remain.

Examples2

  1. Example 1

    Input
    5 2 15
    15 2 33 12 8
    3 4
    
    Expected output
    POSSIBLE
    4 0 5 3 1
    
  2. Example 2

    Input
    4 2 3
    1 2 3 2
    1 2
    
    Expected output
    IMPOSSIBLE