```
class Solution(object):
def countAndSay(self, n):
"""
:type n: int
:rtype: str
"""
prev=""
cur="1"
for i in range(n-1):
prev=cur
cur=""
cnt=1
for s in range(len(prev)):
if s+1<len(prev) and prev[s]==prev[s+1]:
cnt+=1
else:
cur=cur+str(cnt)+str(prev[s])
cnt=1
return cur
```