Under construction

Still being built. Things may change

Corrupted Password

Interview

Time limit2sMemory limit1024 MB

Summary
Given strings s and t, find a position x and a character c different from s_x so that replacing s_x with c makes s a subsequence of t.
Level

Medium5 of 10

Topics
Greedy, String, Two pointers
Solved
No attempts yet

Problem

Vi had a very important secret string ss. He applied the following sequence of actions to it.

  1. He chose a position xx in the string ss (1≤x≤∣s∣1 \le x \le |s|) and replaced sxs_x with a character cc (sx≠cs_x \neq c).
  2. He inserted an arbitrary character at an arbitrary place in the string, zero or more times. A character can be inserted before the first character, between two adjacent characters, or after the last character.

As a result, he got the string tt. You are given the strings ss and tt. Help Vi recall which position xx and character cc he chose.

Input

The first line contains the string ss, consisting of lowercase English letters (1≤∣s∣≤1061 \le |s| \le 10^6).

The second line contains the string tt, consisting of lowercase English letters (∣s∣≤∣t∣≤106|s| \le |t| \le 10^6).

It is guaranteed that tt was obtained from ss by the process described above.

Output

Print a position xx and a character cc that Vi could have chosen. Note that sx≠cs_x \neq c must hold. If there are multiple answers, you may print any of them.

Examples1

  1. Example 1

    Input
    abc
    aacc
    
    Expected output
    2 a