跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1956. Three strings

    ID: 1962 传统题 2000ms 256MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>待分类整理状态难度待定难度共享题库Codeforces英文题面题目来源题面语言

Three strings

题目描述

E. Three strings
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given three strings (s1,s2,s3). For each integer l (1≤lmin(|s1|,|s2|,|s3|) you need to find how many triples (i1,i2,i3) exist such that three strings sk[ik... ik+l-1] (k=1,2,3) are pairwise equal. Print all found numbers modulo 1000000007(109+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·105. All strings consist only of lowercase English letters.

Output

You need to output min(|s1|,|s2|,|s3|) numbers separated by spaces − answers for the problem modulo 1000000007(109+7).

Examples
Input
abc
bc
cbc
Output
3 1 
Input
abacaba
abac
abcd
Output
11 2 0 0 
Note

Consider a string t=t1t2... t|t|, where ti denotes the i-th character of the string, and |t| denotes the length of the string.

Then t[i... j] (1≤ij≤|t|) represents the string titi+1... tj (substring of t from position i to position j inclusive).


题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1536 题。保留原作者与原赛事署名。