class Solution(object):
    def maximum69Number (self, num):
        s=[c for c in str(num)]
        for i in range(len(s)):
            if s[i]=="6":
                s[i]="9"
                break
        return int("".join(s))
