n=STDIN.gets.to_i keta=n/2 n7=0 while n7*3<=n if n7+(n-n7*3)/2n n7-=1 end n7.times do |i| print 7 end ((n-n7*3)/2).times do |i| print 1 end puts ""