#Lutece1604. two strings

two strings

Migrated from Lutece 1604 two strings

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

memeda有两个字符串。母串SS只包含小写字母,询问串TT包含小写字母和通配符??

如果满足以下三种情况中的任意一种 我们可以视为询问串的字符TjT_j与母串字符SiS_i匹配

  • 1.Si==Tj1.S_i == T_j
  • 2.(Si+i)2.(S_i+i) % 26==26 == TjT_j (将小写字母aazz002525编号后运算)
  • 3.Tj3.T_j为通配符

memeda想知道询问串TT在母串SS中出现了几次 分别出现在什么位置 下标从00开始

Input

输入两行 分别为SSTT

TS100000|T|\leq |S| \leq 100000

Output

第一行为TTSS中出现的次数kk

接下来kk行正整数,分别代表TT每次在SS中出现的开始位置。按照从小到大的顺序输出。

Samples

aacccaabca
c?caa
1
2

Resources

每周一题 Div1