
object Main extends App {

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

  val isUp = 1L << 53
  solve
  def solve: Unit = {
    val n = readLine.trim.toLong
    if (n == 0) return
    val origin = readLine.trim.toCharArray.map {
      _.asDigit
    }.toLong

    var rest = n
    var e = 0
    var s = origin + (1L << 52)
    var a = origin + (1L << 52)
    while (rest != 0 && a != 0) {
      val untilUp = (isUp - s + a - 1) / a
      if (rest >= untilUp) {
        rest -= untilUp
        s += a * untilUp
        e += 1
        s /= 2
        a /= 2
      } else {
        s += a * rest
        rest = 0L
      }
    }
    println(
      e.toBinaryExpression(12) + (s - (1L << 52)).toBinaryExpression(52)
    )
    solve
  }
  implicit class ConvertLong(val value: Long){
    def toBinaryExpression(digit: Int): String = {
      var result: List[Long] = Nil
      var rest = value
      for (_ ← 0 until digit){
        result ::= rest % 2
        rest /= 2
      }
      result.mkString
    }
  }
  implicit class ConvertString(val array: Array[Int]) {
    def toLong: Long = array.foldLeft(0L){case (l, r) ⇒ l * 2 + r}
  }
  implicit class Extension[T](val value :T){
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
    def let[R](func: T ⇒ R): R = func(value)
  }
}
