{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\n As is known to all, in many cases, a word has two meanings. Such as \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e“hehe”\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e, which not only means \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e“hehe”\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e, but also means “excuse me”.\n\u003c/div\u003e \n\u003cdiv\u003e\n 众所周知,在许多情况下,一个词语有两种意思。比如“hehe”,不仅意味着“hehe”,还意味着“excuse me”。\n\u003c/div\u003e \n\u003cdiv\u003e \n \u003cbr\u003e Today, ?? is \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003echating\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e with \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003eMeiZi\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e online, \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003eMeiZi\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e sends a sentence A to ??. ?? is so smart that he knows the word B in the sentence has two meanings. He wants to know how many kinds of meanings \n \u003cspan\u003e\u003cspan\u003e\u003cspan\u003eMeiZi\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e can express.\n\u003c/div\u003e \n\u003cdiv\u003e\n 现在,某某在和妹纸在线聊天,妹纸发送了一个句子A给某某。某某很聪明,知道这个句子中的词语B有两种意思。他想知道妹纸有多少种可能想表达的意思。\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e The first line of the input gives the number of test cases T; T test cases follow.\u003cbr\u003e Each test case contains two strings A and B, A means the sentence \u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003eMeiZi\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e sends to ??, B means the word B which has two \u003cspan\u003e\u003cspan\u003e\u003cspan\u003emenaings\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e. string only contains lowercase letters.\u003cbr\u003e \u003cbr\u003e Limits\u003cbr\u003e T \u0026lt;\u003d 30\u003cbr\u003e |A| \u0026lt;\u003d 100000\u003cbr\u003e |B| \u0026lt;\u003d |A|\u003cbr\u003e \u003cbr\u003e \u0026nbsp;\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e For each test case, output one line containing “Case #x: y” (without quotes) , where x is the test case number (starting from 1) and y is the number of the different meaning of this sentence may be. Since this number may be quite large, you should output the answer modulo 1000000007.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n4\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ehehehe\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ehehe\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ewoquxizaolehehe\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ewoquxizaole\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ehehehehe\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003ehehe\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003eowoadiuhzgneninougur\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\r\n\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e\u003cspan\u003eiehiehieh\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\nCase #1: 3\r\nCase #2: 2\r\nCase #3: 5\r\nCase #4: 1\r\n\r\n\r\n \r\n \u003ci\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003e\r\n\u003c/pre\u003e \n\u003cdiv\u003e \n \u003cpre\u003e\r\n\t\u003cspan\u003e在第一个样例\u003c/span\u003e, “ \u003cspan\u003ehehehe”\u003c/span\u003e \u003cspan\u003e可以有3个意思\u003c/span\u003e: “*he”, “he*”, \u003cspan\u003e“hehehe”\u003c/span\u003e. \u003cspan\u003e在第三个样例\u003c/span\u003e, \u003cspan\u003e“hehehehe”\u003c/span\u003e \u003cspan\u003e可以有5个意思\u003c/span\u003e: “* \u003cspan\u003ehehe”\u003c/span\u003e, “he*he”, \u003cspan\u003e“hehe\u003c/span\u003e*”, “**”, \u003cspan\u003e“hehehehe”\u003c/span\u003e.\u003c/pre\u003e \n\u003c/div\u003e"}}]}