n = gets.chomp.to_i 1.upto(n / 2) do |i| x = n - i if ( i.to_s.count('7') == 0 && x.to_s.count('7') == 0 ) printf("%d %d\n", i, x) exit end end