def a(seats)
  seats[seats.index("#")] = "A"
end

def b(seats, n)
  (n - 1).downto(0) do |i|
    if (i - 1 < 0 || seats[i - 1] != "A") && seats[i + 1] != "A" &&
        seats[i] == "#"
      seats[i] = "B"
      return
    end
  end
  seats[seats.index("#")] = "B"
end

def c(seats, n)
  if seats.count("#") == n
    idx = n / 2
  else
    n.times do |i|
      if seats[i] != "#"
        if seats[i + 1] == "#"
          idx = i + 1
          break
        elsif i - 1 >= 0 && seats[i - 1] == "#"
          idx = i - 1
          break
        end
      end
    end
  end
  seats[idx] = "C"
end

def d(seats, n)
  idx = 0
  if seats.count("#") != n
    max_dist = 0
    n.times do |i|
      d = nearest_dist(seats, i)
      if d > max_dist
        max_dist = d
        idx = i
      end    
    end
  end
  seats[idx] = "D"
end

def nearest_dist(seats, i)
  dist = 0
  dist += 1 until /[A-D]/ =~ seats[i + dist] ||
                  (i - dist >= 0 && /[A-D]/ =~ seats[i - dist])
  dist
end

until (given = gets.split.map(&:to_i)) == [0, 0]
  n, m = given
  seats = "#" * n
  m.times do
    case gets.chomp
    when "A" then a(seats)
    when "B" then b(seats, n)
    when "C" then c(seats, n)
    when "D" then d(seats, n)
    end
  end
  puts seats
end

