题库练习 Spelling Check
← 上一题 下一题 →

A7912 | Spelling Check

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Petya has noticed that when he types using a keyboard, he often presses extra buttons and adds extra letters to the words. Of course, the spell-checking system underlines the words for him and he has to click every word and choose the right variant. Petya got fed up with correcting his mistakes himself, that’s why he decided to invent the function that will correct the words itself. Petya started from analyzing the case that happens to him most of the time, when all one needs is to delete one letter for the word to match a word from the dictionary. Thus, Petya faces one mini-task: he has a printed word and a word from the dictionary, and he should delete one letter from the first word to get the second one. And now the very non-trivial question that Petya faces is: which letter should he delete?

输入格式

The input data contains two strings, consisting of lower-case Latin letters. The length of each string is from $1$ to $10^{6}$ symbols inclusive, the first string contains exactly $1$ symbol more than the second one.

输出格式

In the first line output the number of positions of the symbols in the first string, after the deleting of which the first string becomes identical to the second one. In the second line output space-separated positions of these symbols in increasing order. The positions are numbered starting from $1$ . If it is impossible to make the first string identical to the second string by deleting one symbol, output one number $0$ .

输入输出样例

输入 #1
abdrakadabra
abrakadabra
输出 #1
1
3
输入 #2
aa
a
输出 #2
2
1 2
输入 #3
competition
codeforces
输出 #3
0
C++ 编辑器
输入
输出