n = gets.to_i
q, r = n.divmod(2)

print r == 1 ? '7' : '1'
puts '1' * (q - 1)