Both have both felt the shadow of Russia’s war in Ukraine, and both are former Soviet republics.