#Lutece1317. Keywords Again
Keywords Again
Migrated from Lutece 1317 Keywords Again
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Do you like the Problem K in Preliminary Contest? Now, this is another Keywords Problem.
Given a generated way:
Start with an empty string . Then, choose some position in the string (maybe the very beginning or the very end) and insert . We will get a new and try to insert it again and again.
For example, is abc
and is empty, after a single step, becomes abc
. Now Insert into again, may become aabcbc
.
Now show you a string , can you tell me if there exists a string generated as we mentioned above, and is the substring of .
Input
The first line contains a non-empty string .
The second line contains a non-empty string .
Both and will only contains a
to z
Output
If there exists a string generated as we mentioned above, and is the substring of , output POSSIBLE
, otherwise output IMPOSSIBLE
.
Samples
abcde
bcaab
POSSIBLE
abcde
eabde
IMPOSSIBLE
Resources
The 14th UESTC Programming Contest Final