CF119D String Transformation

Description

Let $ s $ be a string whose length equals $ n $ . Its characters are numbered from 0 to $ n-1 $ , $ i $ and $ j $ are integers, $ 0

Input Format

The first two input lines are non-empty strings $ a $ and $ b $ correspondingly. Each string's length does not exceed $ 10^{6} $ characters. The strings can contain any characters with ASCII codes from 32 to 126 inclusive.

Output Format

Print two integers $ i $ , $ j $ — the answer to the problem. If no solution exists, print "-1 -1" (without the quotes).