Original: Japan did enjoy friendly relations with Silla as well as formal relationships with Tang China.
Simplified: At that time, Japan had friendly relations with Korea and China's Tang Dynasty.