Ukraine gains territory, grain deal renewal uncertain