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