What was the most important factor for early civilizations to settle in river valleys?