
object Main extends App {

  import scala.io.StdIn._
  import scala.math._

  val n = readLine.trim.toInt
  val target = readLine.trim.toList
  for (_ ← 0 until n){
    println(
      if (target < readLine.trim.toList) '+'
      else '-'
    )
  }

  def <(a: List[Char], b:List[Char]): Boolean = {
    (a, b) match {
      case (Nil, _) ⇒ true
      case (_, Nil) ⇒ false
      case (an Numbers at, bn Numbers bt) ⇒ if (an == bn) at < bt else an < bn
      case (ah::_, _) if ah.isDigit ⇒ true
      case (_, bh::_) if bh.isDigit ⇒ false
      case (ah::at, bh::bt) if ah == bh ⇒ at < bt
      case (ah::_, bh::_) ⇒ ah < bh
    }
  }
  implicit class ListExtend(val value: List[Char]){
    def <(b: List[Char]): Boolean = Main.<(value, b)
  }
  object Numbers{
    def unapply(express: List[Char]): Option[(Int, List[Char])] = {
      express match {
        case h::t if h.isDigit ⇒ Some(subUnapply(express))
        case _ ⇒ None
      }
    }
    private def subUnapply(express: List[Char], number: Int = 0): (Int, List[Char]) = {
      express match {
        case h::t if h.isDigit ⇒ subUnapply(t, number * 10 + h.asDigit)
        case _ ⇒ (number, express)
      }
    }
  }
  implicit class Extenion[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}
