South Africa strives to work with all countries, says president