### subroutines

def lower_bound(arr, key)
  lb = - 1
  ub = arr.length - 1

  while lb + 1 < ub
    m = (lb + ub) / 2
    if arr[m] <= key
      ub = m
    else
      lb = m
    end
  end
  ub
end

### main

while true
  n = gets.strip.to_i
  break if n == 0

  as = gets.strip.split(' ').map{|s| s.to_i}.sort{|a, b| b <=> a}
  bs = gets.strip.split(' ').map{|s| s.to_i}.sort{|a, b| b <=> a}

  done = false
  bwin = 0
  k = 1

  while k < n
    pos = lower_bound(bs, as[k - 1] - 1) - 1
    if bwin <= pos
      bwin += 1
    end

    if (k - bwin) > k / 2
      done = true
      break
    end

    k += 1
  end

  puts (done ? k : 'NA')
end