n = gets.to_i str = "" if n % 2 == 0 (n / 2).times { |i| str += "1" } else str = "7" (n / 2 - 1).times { |i| str += "1" } end puts str