Aklank
Practice
4.3 (3 votes)
Easy Medium
Problem
64% Success 1599 Attempts 30 Points 5s Time Limit 256MB Memory 1024 KB Max Code

Aklank has a habit of challenging his friends in different games. But every time he fails to defeat them and gets frustrated. So, this time he devised one game and named it "Bakkund". Bakkund is played between two players. Initially there will be N integers. In each turn one player can select any of the n integer and divide it either by a or b either once or more than one times. He can choose to continue until it is divisible by either a or b.

Suppose an integer is 6 and a = 2 and b=3: Possible moves are :

1) 6/2 = 3

2) 6/3 =2

3) 6/2 = 3, 3/3 =1

4) 6/3 = 2, 2/2 =1

If in a particular turn a player is not able to take any move than he loses.

Assume that each time Aklank will start first and both will play optimally. Predict whether Aklank can win the game.

Input

First line will contain three space separated integers N, a and b.

Next line contains N space separated integers Ai.

Output

Print "Aklank's day" if Aklank wins else print "Bad Luck".

Constraint

2 ≤ N, a, b ≤ 100000

1 ≤ Ai ≤ 100000

Setter : Sourav Kumar Paul

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Tags:
Easy-Medium