Game of strings

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

문제

Alisa, Boris and Konstantin are playing a game of strings. The rules are the following:

  1. Alisa chooses a string AA.
  2. Boris chooses a string BB.
  3. Konstantin, who is the game moderator, chooses a positive integer kk.
  4. In the string AA, a substring XX of the length kk is selected randomly. The starting position of the substring is selected equiprobably among all possible cases.
  5. In the same manner, a random substring YY of the length kk is selected in the string BB.
  6. The game outcome depends on which of the strings is lexicographically smaller. If the substring XX is lexicographically smaller than the substring YY, Alisa wins. If the substring YY is lexicographically smaller than the substring XX, Boris wins. If the substrings are equal, friendship wins.

Alisa and Boris have already come up with their strings AA and BB. Konstantin is curious: what is the probability of each of the outcomes? Calculate these probabilities for all reasonable values of the number kk.

입력

The first line of the input file contains a string AA, and the second line contains a string BB. The string AA consists of nn symbols, and the string BB  consists of mm symbols (1n,m21051 \le n, m \le 2 \cdot 10^5). Strings contain only lower case Latin letters.

출력

In the output file, print min(n,m)\min(n, m) lines, with three real numbers in each. The results for the case when Konstantin chooses a number kk, must be placed in the kkth line. The first number in the line defines the probability of Alisa winning, the second is the probability of friendship winning, and the third is about Boris winning.

The deviation of each printed number from the correct value should not be greater than 101210^{-12}.