Limits 1s, 512 MB

In a parallel universe North African nation of the Republic of Wadiya has been ruled by Admiral-General Haffaz Aladeen. The Dictator Aladeen build a video game called ‘Dead-land'. Aladeen forces one of his employee named ‘Abul Bhai’ to become first experimental user of the game.

In this game if ‘Abul Bhai’ win PP number of matches consecutively Aladeen will punish him for hacking the game and if ‘Abul Bhai’ lose QQ number of matches consecutively again he will be punished by Aladeen for being a loser. If ‘Abul Bhai’ is able to skip both cases he is safe.

Determine whether ‘Abul Bhai’ is safe or not.

Input

The first line of input contains three integers N(1N2×105)N \hspace{.1cm} (1 \leq N \leq 2×10^5 ), P(1P105)P \hspace{.1cm} (1 \leq P \leq 10^5) & Q(1Q105)Q \hspace{.1cm} (1 \leq Q \leq 10^5).

NN represents the number of matches Abul Bhai played.

The second line of input contains a string SS consisting of NN characters where each character contains 0 or 1. Here, 0 represents that he lost the match and 1 represents he won the match.

Output

If he is safe print “Abul Bhai is safe” else print “Abul Bhai is in danger” (w/o quotes).

Sample

InputOutput
10 5 3                                                 
1010101010 
Abul Bhai is safe

Submit

Login to submit.

Statistics

89% Solution Ratio
aritra741Earliest, Oct '20
aritra741Fastest, 0.0s
EgorKulikovLightest, 0 B
bokaifShortest, 118B
Toph uses cookies. By continuing you agree to our Cookie Policy.