#K11431. Code Keyword Checker

    ID: 23467 Type: Default 1000ms 256MiB

Code Keyword Checker

Code Keyword Checker

You are given a list of reserved keywords and a set of lines of source code. Your task is to determine whether any of the reserved keywords appear as a substring in any of the code lines. If at least one reserved keyword is found, print Disqualified; otherwise, print Qualified.

Details:

  • Let \(N\) be the number of reserved keywords.
  • Followed by \(N\) lines each containing a reserved keyword.
  • Then an integer \(M\) denotes the number of lines of code.
  • Followed by \(M\) lines representing the source code.

Example:

Input:
2
private
public
4
class Example {
    void method() {
    }
}

Output: Qualified

</p>

Note: A keyword is considered present if it appears as a substring in any code line.

inputFormat

The input is read from stdin and is structured as follows:

  1. An integer \(N\) indicating the number of reserved keywords.
  2. \(N\) lines each containing a reserved keyword.
  3. An integer \(M\) indicating the number of lines of source code.
  4. \(M\) lines of code.

outputFormat

Print a single line to stdout containing either Qualified or Disqualified based on whether any reserved keyword is found in the code.

## sample
2
private
public
4
class Example {
    void method() {
    }
}
Qualified

</p>