<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nth_char(char_map, index):
 """Returns the nth character of a character->occurrence map"""

    for char in char_map:
        if index < char_map[char]:
            return char
        index = index - char_map[char]
    return None