The Polyakov string in O(N)or SU(N) group space