def win?(a, b)
  return false if a.size == 0
  n = a.size
  win = draw = lose = 0
  (1...(b.max)).each do |d|
    (0...n).each do |j|
      next unless b[j]
      (0...n).each do |i|
        next unless a[i]
        next unless b[j] - a[i] == d
        a[i] = b[j] = nil
        lose += 1
        break
      end
    end
  end
  (0...n).each do |j|
    next unless b[j]
    (0...n).each do |i|
      next unless a[i]
      next unless b[j] == a[i]
      a[i] = b[j] = nil
      draw += 1
    end
  end
  win = n - lose - draw
  win > lose
end

until (n = gets.to_i).zero?
  a, b = 2.times.map{gets.split.map(&:to_i).sort{|a, b| b <=> a}}
  answer = (1..n).find{|i| win?(a[0, i], b[0, i])}
  puts answer ? answer : "NA"
end