#!/usr/bin/perl

($decimal, $binary) = (shift, '');
$SIG(USR1) = sub { $binary .= "0"};
$SIG(USR2) = sub { $binary .= "1"};

do { kill $decimal & 1 ? 'USR2' : 'USR1' , $$;
     $decimal >>= 1;
} while ($decimal);

print scalar reverse $binary;

