~/algor $ cat problems/string/first-and-last-position-of-a-letter
First and last position of a letter
Easy
1000 ms
64 MB
22%
A string and a letter are given. At which positions does occur in for the first and for the last time? Positions are numbered from . If the letter occurs once, both numbers are the same; if it does not occur at all, print .
Input
The first line contains the string , the second line a single letter .
Output
Two space-separated integers or .
Note
and consist of lowercase Latin letters
Examples
Input #1
algoritm o
Output #1
4 4
Input #2
salom z
Output #2
-1