The Ukrainian president said would resign "immediately" if his country was offered NATO membership.