Scientists are constantly listening for aliens. Because of the great distances, some things may come more delayed than others. Thus they need an algorithm that when given two strings, and , determines whether it is possible to make by taking a single substring of and moving it to another index. It should also detect aliens when the two strings are the same.
Input Specification
The input will consist of two newline separated strings, and . Each string will only consist of lowercase letters.
Output Specification
Output aliens
if it is possible, else no aliens
.
Sample Input 1
abcdef
abcfde
Sample Output 1
aliens
Explanation for Sample 1
The substring f
was moved to after index (starting with ).
Sample Input 2
abcdef
acbdfe
Sample Output 2
no aliens
Explanation for Sample 2
There is no single substring that can be moved to create the new string.
Comments