Insertions

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

We are given three strings, ss, tt and pp. We will denote the length of a string by vertical bars, thus s|s| is the length of ss and so on. If we insert tt into ss at position kk, where 0ks0 \le k \le |s|, the result is a new string consisting of the first kk characters of ss, followed by the entirety of tt, and finally followed by the remaining sk|s| - k characters of ss. We would like to select kk so that the resulting new string will contain the largest possible number of occurrences of pp as a substring.

Thus, for example, inserting t=t = aba into s=s = ab at position k=0k = 0 results in the string abaab; at k=1k = 1, in the string aabab; and at k=2k = 2, in the string ababa. If we are interested in occurrences of p=p = aba, then the best position to insert tt into ss is k=2k = 2, where we get two occurrences: ababa and ababa (as this example shows, occurrences of pp are allowed to overlap). If, on the other hand, we were interested in occurrences of p=p = aa, then the best choices of kk would be k=0k = 0 and k=1k = 1, which result in one occurrence of pp, whereas k=2k = 2 results in 0 occurrences of pp.

입력

The first line contains the string ss, the second line the string tt, and the third line the string pp.

출력

Output one line containing the following four integers, separated by spaces:

  1. The maximum number of occurrences of pp we can get after inserting tt into ss at position kk, if we choose the position kk wisely.
  2. The number of different kk's (from the range 0,1,,s0, 1, \ldots, |s|) where this maximum number of occurrences of pp is attained.
  3. The minimum value of kk where the maximum number of occurrences of pp is attained.
  4. The maximum value of kk where the maximum number of occurrences of pp is attained.

제한

  • 1s1051 \leq |s| \leq 10^5
  • 1t1051 \leq |t| \leq 10^5
  • 1p1051 \leq |p| \leq 10^5
  • All the strings consist only of lowercase letters of the English alphabet.

힌트

The first of these three examples is the one discussed earlier in the problem statement.