class P0175
  def main
    while (n=gets.to_i)!=-1
      digit= if n!=0
               Math.log(n, 4).ceil
             else
               0
             end
      t1=0; t2=0
      for i in 0..digit do
        t1=n%4
        n/=4
        t2+=t1*(10**i)
      end
      puts t2
    end
  end
end

P0175.new.main