
object Main extends App {

  import scala.io.StdIn._

  val Array(v, e) = readLine.trim.split(' ').map(_.toInt)
  val circles = readLine.trim.split(' ').map(_.head)
  val edges = Array.tabulate(v){_ ⇒ Nil: List[Int]}
  for (_ ← 0 until e){
    val Array(s, t) = readLine.trim.split(' ').map(_.toInt)
    edges(s) ::= t
    edges(t) ::= s
  }
  for (i ← 0 until v){
    if (circles(i) == '?'){
      circles(i) = edges(i).map(j ⇒ circles(j)).filterNot(_ == '?').let(a ⇒ ('a' to 'z').find(c ⇒ !a.contains(c))).get
    }
  }
  println(circles.mkString)
  implicit class Extend[T](value: T){
    def also(func: T ⇒ Unit): T = {func(value); value}
    def let[A](func: T ⇒ A): A = func(value)
  }
}
