Implement the CountAndSay sequence.
Given a positive integer n, return the nth term of the Count-and-Say sequence. The sequence starts with "1"; each later term describes consecutive groups of identical digits in the previous term. Implement count_and_say(n) so it returns a string.
Examples: n = 1 returns "1", and n = 4 returns "1211" because "21" is described as one 2 followed by one 1.
Constraints: 1 <= n <= 30.
def count_and_say(n):