Problem list
Log in
#r03525 · CCC 2016 Senior

Ragaman

Bronze II 2.0 s 256 MB

An anagram of a string is formed by rearranging the letters in the string. For example, the anagrams of aab are aab, aba, and baa.

A wildcard anagram of a string is an anagram of the string where some of the letters might have been replaced with an asterisk (*). For example, two possible wildcard anagrams of aab are ab and b*.

Given two strings, determine whether the second string is a wildcard anagram of the first string.

Input

The two lines of input will both consist of $N$ $(1 \leq N \leq 100)$ characters. Each character in the first line will be a lowercase letter. Each character in the second line will be either a lowercase letter or an asterisk.

For 8 of the 15 available marks, the second line will not contain any asterisk characters.

Output

Output the character A if the string on the second line is a wildcard anagram of the string on the first line. Otherwise, output the character N.

Constraints

$(1 \leq N \leq 100)$

Example 1

Input
abba
baaa
Output
N

Example 2

Input
cccrocks
socc*rk*
Output
A
Source
CCC 2016 Senior
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code