Better to send child to a good elementary school or good high school?

Our local public school district has neighborhoods with a good elementary school or good high school but not both (with the exception of one expensive neighborhood). Private schools for 12 years are out of our budget, though we may need to spring for private middle school. If we had to choose, would a good elementary school or good high school be more important to the child’s long-term academic success?