class Solution:
    def maximum69Number (self, num: int) -> int:
        
        num = str(num)
        for i in range(len(num)):
            if int(num[i])==6:
                n = num[:i]+"9"+num[i+1:]
                return n
        return num
                
        