President Trump’s visit to Japan carried a message for South Korea as much as anywhere else. It’s time to call a halt to outpourings of anti-Japanese sentiment.

That’s not to say South Koreans should bury their bitterness over decades of Japanese rule, the slaughter of Koreans after the revolution of March 1, 1919, or indeed the general sense of superiority that many Japanese still harbor over Koreans.

Nor should Koreans have to give up their vigils around statues of Korean comfort women, most visibly across the street from the Japanese Embassy in Seoul. Those images serve as enduring reminders of the suffering inflicted on Korean women in World War II. Activists have a right to remind the world of a legacy that Japanese would prefer either to forget or deny.

And for sure Koreans should go on clinging to Dokdo, those rocky crags in the East Sea, a.k.a. “Sea of Japan” on international maps. The fact that the Japanese refuse to drop their claim to Dokdo, which they insist on calling Takeshima, is an irritating reminder of Japanese complexes about Korea, which they have been invading periodically for centuries.

Despite historic differences, however, Japan and South Korea have much more reason to get along with each other than to engage in destructive rhetoric and refuse to cooperate, most especially in defense against a potential foe. Just as the Americans go on working with their Korean ally despite Trump’s cancellation of joint military exercises, so Japanese and South Koreans need to coordinate in an uncertain period in which to expect the unexpected.

The notion of Japan and South Korea engaging in small-scale joint exercises, in naval maneuvers, in intelligence-sharing and computerized war games, may seem absurd considering President Moon Jae-in’s undying hopes for reconciliation and dialog with North Korea. Kim Jong-un, however, is an extremely unreliable interlocutor whose primary interest seems to be to undermine the U.S.-South Korea alliance and maneuver the Americans into deserting the South.

No one is suggesting Japan and South Korea form their own alliance, which would be totally impossible in an atmosphere of recriminations going deep into history, but there are innumerable ways to bring the two countries closer together. Both, after all, are within easy missile range of North Korea, which shows no sign of giving up its arsenal regardless of whether they’re only testing “projectiles,” as Trump said in Tokyo, or honest-to-goodness missiles, as claimed by his security adviser, John Bolton, and Japan’s Prime Minister Shinzo Abe.

South Korea and Japan might also share common cause in abduction of their citizens by North Korea. Several hundred South Korean fishermen, captured on or near North Korean waters, remain in North Korea as do South Koreans kidnapped off beaches and the pilot, co-pilot, two hostesses and seven passengers of a Korean Air plane hijacked on a domestic flight nearly half a century ago. Moon has remained silent on the fate of South Koreans held in North Korea while the Japanese have waged a crusade on behalf of several dozen Japanese kidnapped to North Korea whose fate remains largely unknown.

Trump’s visit to Japan may have produced little of substance but was laden with symbolic value reflecting the depth of the U.S.-Japan alliance. The call that he and first lady Melania paid on the newly ensconced Emperor Naruhito and Empress Masako was greeted with euphoria by Japanese even if just a photo-op in the American media. Trump will be back in Japan near the end of June when he joins other heads of state at the G20 summit in Osaka, a chance to haggle over economic differences.

The U.S. relationship with Japan is inseparable from that of the U.S. alliance with South Korea. It’s against that background that Trump will be seeing Moon in Seoul after the G20. Top item on the agenda should be Moon’s desire for Trump to strike a deal with Kim Jong-un, making up for the failure of the Trump-Kim summit at the end of February.

A Trump-Moon summit will go much more smoothly than would otherwise be possible if the Americans sensed that relations between Japan and South Korea were also improving. Why not a Moon-Abe summit? Such a show of highest-level diplomacy would definitely demonstrate the possibilities for trilateral cooperation.

Kim Jong-un might not like it, but unity among the United States and its two northeast Asian allies should show the utter futility of playing dangerous games with nukes and missiles. He might at least see the advantages of getting along better with Japan as well as South Korea and the United States even if he’s never going to go through with denuclearization.