#!/usr/bin/python3

pos = 0
p, phrase = [x for x in input().split()]
for i in range(len(phrase)):
    if pos < len(p) - 1:
        if phrase[i] != p[pos]:
            if phrase[i] in p[pos + 1::]:
                print("FAIL")
                break
            if i == len(phrase) - 1:
                print("FAIL")
                break
        else:
            pos += 1
    else:
        if i < len(phrase) - 1:
            if phrase[i] == p[pos]:
                print("PASS")
                break
        else:
            if phrase[i] == p[pos]:
                print("PASS")
                break
            else:
                print("FAIL")
                break

96145d2aa669e676a30834926aaf6c17bb327d8b
<mask token>

<mask token>
for i in range(len(phrase)):
    if pos < len(p) - 1:
        if phrase[i] != p[pos]:
            if phrase[i] in p[pos + 1:]:
                print('FAIL')
                break
            if i == len(phrase) - 1:
                print('FAIL')
                break
        else:
            pos += 1
    elif i < len(phrase) - 1:
        if phrase[i] == p[pos]:
            print('PASS')
            break
    elif phrase[i] == p[pos]:
        print('PASS')
        break
    else:
        print('FAIL')
        break

pos = 0
p, phrase = [x for x in input().split()]
for i in range(len(phrase)):
    if pos < len(p) - 1:
        if phrase[i] != p[pos]:
            if phrase[i] in p[pos + 1:]:
                print('FAIL')
                break
            if i == len(phrase) - 1:
                print('FAIL')
                break
        else:
            pos += 1
    elif i < len(phrase) - 1:
        if phrase[i] == p[pos]:
            print('PASS')
            break
    elif phrase[i] == p[pos]:
        print('PASS')
        break
    else:
        print('FAIL')
        break

#!/usr/bin/python3

pos = 0
p, phrase = [x for x in input().split()]
for i in range(len(phrase)):
    if pos < len(p) - 1:
        if phrase[i] != p[pos]:
            if phrase[i] in p[pos + 1::]:
                print("FAIL")
                break
            if i == len(phrase) - 1:
                print("FAIL")
                break
        else:
            pos += 1
    else:
        if i < len(phrase) - 1:
            if phrase[i] == p[pos]:
                print("PASS")
                break
        else:
            if phrase[i] == p[pos]:
                print("PASS")
                break
            else:
                print("FAIL")
                break
