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 number of matches consecutively Aladeen will punish him for hacking the game and if ‘Abul Bhai’ lose 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.
The first line of input contains three integers , & .
represents the number of matches Abul Bhai played.
The second line of input contains a string consisting of characters where each character contains 0 or 1. Here, 0 represents that he lost the match and 1 represents he won the match.
If he is safe print “Abul Bhai is safe” else print “Abul Bhai is in danger” (w/o quotes).
Input | Output |
---|---|
10 5 3 1010101010 | Abul Bhai is safe |