E - EString

Languages: C, C++, Java, Tiger, Python, Pascal, JavaScript, Haskell, C#
Time & Memory limits: (details)

Imagine an string $S$ with length $N$ where each character in numbered from $0$ to $N - 1$. If you take two integers $i$, $j$; $0 \leq i \lt j \leq N$ and the magic function $\text{F}$ you can get the following string:

$\text{F}(S, i, j) = s[i + 1…j - 1] + \text{r}(s[j…N-1]) + \text{r}(s[0…i])$

  • $S[p…q]$ is the substring of $S$ starting at position $p$ and ending at position $q$ (inclusive).
  • $+$ is the string concatenation.
  • $\text{r}(x)$ is a string resulting from writing the characters of $x$ in reverse order.

If $j = i + 1$ then the substring $s[i + 1…j - 1]$ is considered empty.

You are given two strings $A$ and $B$. Find two values $i$, $j$ that $\text{F}(A,i,j) = B$. Number $i$ sould be as big as possible. If for this $i$ you have several valid values for $j$, chose the minimal $j$.

Input

Two lines, one string on each line. The length of both string is not greater than $10^6$ characters. The string contains any character with ASCII code from $32$ to $126$ inclusive.

Output

Two integers, the values for $i$ and $j$. if no solution is possible print $\texttt{“-1 -1”}$ without the quotes.

Sample test(s)

Input
Die Polizei untersucht eine Straftat im IT-Bereich. untersucht eine Straftat.hciereB-TI mi ieziloP eiD
Output
11 36
Input
cbaaaa aaaabc
Output
4 5