QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#13065. A String Game

统计

Recently Alice and Bob are playing a game about strings. Before starting the game, they should prepare $n$ strings $s_1$, $s_2$, ..., $s_n$ and a target string $t$. It's promised that each of these $n$ strings is a substring of $t$.

When the game begins, they do the following things alternately while Alice starts first:

  • Choose a string $s_i$ from the $n$ strings;
  • Append one letter to the chosen string;
  • The new string must also be a substring of $t$.

If the above things cannot be completed, the player loses the game. Suppose Alice and Bob both use optimal strategy, find who will win the game.

Input

The input consists of multiple test cases.

Each test case begins with the non-empty target string $t$, whose length will not exceed $100000$. The second line contains an integer $n$ $(1 \leq n \leq 100)$, the number of strings they prepared. Then $n$ lines follow. The $i$-th line of the following $n$ lines is the string $s_i$. The input guarantees that each of the $n$ strings must be a non-empty substring of $t$.

The total length of all strings will not exceed $30\,000\,000$.

Output

For each test case, output the winner "Alice" or "Bob" (without quotes) in one line.

Example

Input

aaaa
1
a
abcabd
1
a

Output

Alice
Bob
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.