#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ALDS1_14_A
=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