Through the Valley: Path to Effective Long CoT Training for Small Language Models