import scala.io.StdIn.readInt
import scala.collection.mutable.ArrayBuffer

object Main {
  def getQ(n:Int,b:ArrayBuffer[Int]):String = {
    if(n/4==0) {
      b += n%4
      b.toArray.reverse.mkString
    }
    else {
      b += n%4
      getQ(n/4,b)
    }
  }

  def main(args:Array[String]) = {
    var n = -1
    var s1 = "0"
    while({n=readInt;n} != -1) {
      println(getQ(n,new ArrayBuffer[Int]()))
    }
  }

}