8626: ALDS1_14_A : Naive String Search
[Creator : ]
Description
Find places where a string P is found within a text T. Print all indices of T where P found. The indices of T start with 0.
Input
In the first line, a text T is given.
In the second line, a string P is given.
Output
Print an index of T where P found in a line. Print the indices in ascending order.
Constraints
1 ≤ length of T ≤ 1000
1 ≤ length of P ≤ 1000
The input consists of alphabetical characters and digits
1 ≤ length of P ≤ 1000
The input consists of alphabetical characters and digits
Sample 1 Input
aabaaa
aa
Sample 1 Output
0
3
4
Sample 2 Input
xyzz
yz
Sample 2 Output
1
Sample 3 Input
abc
xyz