```
class Solution(object):
def findContestMatch(self, n):
resultArr = self.recursivelyArrange([str(i) for i in range(1, n+1)])
return ",".join(resultArr)
def recursivelyArrange(self, arr):
result = []
for i in range(len(arr)/2):
result.append("("+ arr[i] + "," + arr[-i-1] + ")")
if len(result) == 1:
return result
else:
return self.recursivelyArrange(result)
```