n = gets.to_i is_appear_7 = n % 2 == 1 n -= 3 if is_appear_7 count = n / 2 count.times do print '1' end print '7' if is_appear_7 puts