#abc352b. B - Typing

B - Typing

Score: 200200 points

问题陈述

高桥尝试使用键盘输入一个由小写英文字母组成的字符串 SS

他在打字时只看键盘,不看屏幕。

每当他错误地输入了一个不同的小写英文字母,他就会立即按下退格键。然而,退格键坏了,所以错误输入的字母并没有被删除,实际输入的字符串是 TT

他没有错误地按下除了小写英文字母之外的任何键。

TT 中没有被错误输入的字符被称为正确输入的字符

确定 TT 中正确输入的字符的位置。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Takahashi tried to type a string SS consisting of lowercase English letters using a keyboard.

He was typing while looking only at the keyboard, not the screen.

Whenever he mistakenly typed a different lowercase English letter, he immediately pressed the backspace key. However, the backspace key was broken, so the mistakenly typed letter was not deleted, and the actual string typed was TT.

He did not mistakenly press any keys other than those for lowercase English letters.

The characters in TT that were not mistakenly typed are called correctly typed characters.

Determine the positions in TT of the correctly typed characters.

Constraints

  • SS and TT are strings of lowercase English letters with lengths between 11 and 2×1052 \times 10^5, inclusive.
  • TT is a string obtained by the procedure described in the problem statement.

Input

The input is given from Standard Input in the following format:

SS

TT

Output

Let S|S| be the length of SS. If the correctly typed characters are the A1A_1-th, A2A_2-th, \ldots, ASA_{|S|}-th characters of TT, print the values of A1,A2,,ASA_1, A_2, \ldots, A_{|S|} in this order, separated by spaces.

Ensure that the output is in ascending order. That is, Ai<Ai+1A_i < A_{i + 1} should hold for each 1iS11 \leq i \leq |S| - 1.

Sample Input 1

abc
axbxyc

Sample Output 1

1 3 6

The sequence of Takahashi's typing is as follows:

  • Type a.
  • Try to type b but mistakenly type x.
  • Press the backspace key, but the character is not deleted.
  • Type b.
  • Try to type c but mistakenly type x.
  • Press the backspace key, but the character is not deleted.
  • Try to type c but mistakenly type y.
  • Press the backspace key, but the character is not deleted.
  • Type c.

The correctly typed characters are the first, third, and sixth characters.

Sample Input 2

aaaa
bbbbaaaa

Sample Output 2

5 6 7 8

Sample Input 3

atcoder
atcoder

Sample Output 3

1 2 3 4 5 6 7

Takahashi did not mistakenly type any characters.