------
## 最终结论
```python
def decodeAtIndex(S: str, K: int) -> str:
    size = 0
    
    # Determine the total size of the decoded string
    for char in S:
        if char.isdigit():
            size *= int(char)
        else:
            size += 1
    
    # Loop through the characters in S in reverse order
    for char in reversed(S):
        K %= size
        if K == 0 and char.isalpha():
            return char
        
        if char.isdigit():
            size //= int(char)
        else:
            size -= 1

# Example Usage
# print(decodeAtIndex("leet2code3", 10)) # Output: "o"
# print(decodeAtIndex("ha22", 5))       # Output: "h"
# print(decodeAtIndex("a2345678999999999999999", 1)) # Output: "a"
```