Ukraine and Russia both said they were seeking alternative ways to keep grain supplies flowing after an agreement that allowed exports to Africa, the Middle East, and Asia collapsed when Moscow refused to renew its participation in the deal as it expired on July 18.