import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in);
  def soroban(n: Int) = {
    val c = Array.ofDim[Char](5, 8)
    var m = n
    for(i <- (0 until 5).reverse) {
      c(i)(0) = if (m%10 >= 5) ' ' else '*'
      c(i)(1) = if (m%10 >= 5) '*' else ' '
      c(i)(2) = '='
      for(j <- 3 to 7) {
        c(i)(j) = if (m%5 == j-3) ' ' else '*'
      }
      m /= 10
    }
    c.transpose
  }
  def main(args: Array[String]) {
    while(sc.hasNext) {
      val n = sc.nextInt
      val c = soroban(n)
      c.map(_.mkString).foreach(println)
      if(sc.hasNext) println
    }
  }
}