For each stock, the nearest expiration that is still over 365 days out, so gains qualify for long-term capital gains treatment while paying the least extra time premium.