Pty has a string s and a dictionary.
There are m words in the dictionary. Each word $t_i$ has its value $w_i$.
Define function $f(s,l,r)=$$\sum_{i=1}^m$$occur(s,l,r,t_i)*w_i$ , where $occur(s,l,r,t_i)$ is the number of occurrences of string $t_i$ in s[l...r]
The interest value of string s is $\sum_{l=1}^{\mid s \mid}$$\sum_{r=l}^{\mid s \mid}$$f(s,l,r)^5$
Pty wants to know the interest value of string s.
Since the answer might be very large, print the answer modulo $10^9$ + 7.