What country was the principal ally of South Korea during the war