#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ALDS1_14-B
Discussion Solution Statistics Submit

String Search - String Search
Time Limit : 1 sec, Memory Limit : 262144 KB
?????????????´¢

????????? T ????????????????????? P ??¨?????´????????¨????????¢?????????????????????P ??¨?????´????????¨??????????????????????????? T ?????????????????? i (i = 0, 1, ..., T????????? -1) ???????????????????????±????????????????????????
??\???

????????????????????? T???????????????????????? P ?????????????????????
??????

??????????????????????????????????????????????????????
??¶?´?

    1 ??? T ????????? ??? 1000000
    1 ??? P ????????? ??? 10000
    ?????????????????±?°????????????±??§???????????°???????????§?§??????????????????????

??\?????? 1

aabaaa
aa

????????? 1

0
3
4

??\?????? 2

xyzz
yz

????????? 2

1

??\?????? 3

abc
xyz

????????? 3

=end
class Main

  def initialize()
    fh=STDIN
    t = fh.gets.chomp
    p = fh.gets.chomp

    ans = []
    reg = Regexp.new(p)
    x = (p[0] == "@") ? "X" : "@"

    while i=(t=~ reg)
      ans.push(i)
      t[i] = x
    end

    ans.each{|x|
      puts x
    }
  end

end

if $0 == __FILE__ then
  Main.new
end