n=STDIN.gets.to_i
keta=n/2
n7=0
while n7*3<=n
	if n7+(n-n7*3)/2<keta
		n7-=1
		break
	end
	n7+=1
end
if n7*3>n
	n7-=1
end

n7.times do |i|
	print 7
end
((n-n7*3)/2).times do |i|
	print 1
end
puts ""