#!/usr/bin/perl -w

use strict;

chomp(my($x, $n) = <STDIN>);
printf "%b\n", ($x >> $n) | (($x & (~(~0 << $n))) << (63+1-$n));