Under construction

Still being built. Things may change

Trading Union Departures

Time limit2sMemory limit512 MB

Summary
Starting from country L leaving, each country exits once at least half its original partners have left; decide whether X exits too.
Level

Medium5 of 10

Topics
Graph, Simulation, Queue
Solved
No attempts yet

Problem

A long time ago in a galaxy far, far away, a large interstellar trading union joined countries from all across the galaxy. Recently one of them decided to leave. Other countries are now considering the same, because membership stops paying off once their main trading partners are gone.

You are a citizen of country XX and you want to know whether your country stays in the union. You have written down every pair of countries that trade with each other. If at least half of the original trading partners of a country YY leave the union, YY leaves soon after. Country LL is the only country that leaves on its own; every other departure follows from that rule.

The partner count of a country is fixed by the list in the input and never shrinks when a partner leaves. Decide whether country XX leaves the union once no further departure happens.

Input

The first line contains four space separated integers CC, PP, XX and LL. CC is the number of countries (2≤C≤2000002 \le C \le 200000), PP is the number of trading partnerships (1≤P≤3000001 \le P \le 300000), XX is the number of your home country (1≤X≤C1 \le X \le C), and LL is the number of the first country to leave (1≤L≤C1 \le L \le C).

Each of the next PP lines contains two space separated integers AiA_i and BiB_i with 1≤Ai<Bi≤C1 \le A_i < B_i \le C. Such a line means countries AiA_i and BiB_i are trading partners. No pair of countries is listed more than once.

Initially every country has at least one trading partner in the union.

Output

Print one line containing leave if country XX leaves the union, or stay if it remains.

Examples4

  1. Example 1

    Input
    4 3 4 1
    2 3
    2 4
    1 2
    
    Expected output
    stay
    
  2. Example 2

    Input
    5 5 1 1
    3 4
    1 2
    2 3
    1 3
    2 5
    
    Expected output
    leave
    
  3. Example 3

    Input
    4 5 3 1
    1 2
    1 3
    2 3
    2 4
    3 4
    
    Expected output
    stay
    
  4. Example 4

    Input
    10 14 1 10
    1 2
    1 3
    1 4
    2 5
    3 5
    4 5
    5 6
    5 7
    5 8
    5 9
    6 10
    7 10
    8 10
    9 10
    
    Expected output
    leave