MemSQL Start[c]UP 2.0 - Round 1
E
Three strings
Codeforces
2400
原题
← DF →
翻译中…

You are given three strings $(*s*_{1}, *s*_{2}, *s*_{3})$. For each integer $*l*$ $(1 ≤ *l* ≤ *min*(|*s*_{1}|, |*s*_{2}|, |*s*_{3}|)$ you need to find how many triples ($*i*_{1}, *i*_{2}, *i*_{3}$) exist such that three strings $*s*_{*k*}[*i*_{*k*}... *i*_{*k*} + *l* - 1]$ $(*k* = 1, 2, 3)$ are pairwise equal. Print all found numbers modulo $1000000007 (10^{9} + 7)$.

翻译中…

See notes if you are not sure about some of the denotions used in the statement.

翻译中…

Input

翻译中…

First three lines contain three non-empty input strings. The sum of lengths of all strings is no more than $3·10^{5}$. All strings consist only of lowercase English letters.

翻译中…

Output

翻译中…

You need to output $*min*(|*s*_{1}|, |*s*_{2}|, |*s*_{3}|)$ numbers separated by spaces — answers for the problem modulo $1000000007 (10^{9} + 7)$.

翻译中…

Note

翻译中…

Consider a string $*t* = *t*_{1}*t*_{2}... *t*_{|*t*|}$, where $*t*_{*i*}$ denotes the $*i*$-th character of the string, and $|*t*|$ denotes the length of the string.

翻译中…

Then $*t*[*i*... *j*]$ $(1 ≤ *i* ≤ *j* ≤ |*t*|)$ represents the string $*t*_{*i*}*t*_{*i* + 1}... *t*_{*j*}$ (substring of $*t*$ from position $*i*$ to position $*j*$ inclusive).

翻译中…

样例

Input #1
abc
bc
cbc
Output #1
3 1
InputCopy OutputCopy
Input #2
abacaba
abac
abcd
Output #2
11 2 0 0
InputCopy OutputCopy
题目信息
题号
452E
时间限制
2 s
内存限制
256 MB
标签
数据结构
并查集
后缀结构
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。