Kim was treated as a major world leader in Beijing, and gained practical support from his two big neighbours.