Signature of a three-dimensional heliosphere in the spectra of anomalous cosmic rays