#!/usr/bin/perl
($_,$n)=@ARGV;
while (length($_) < $n) {
	tr/01/23/;
	s/2/001/g;	
	s/3/101/g;	
	}
print substr($_,0,$n),"\n"