def minimize_string_value(s):
    s = list(s)
    n = len(s)
    for i in range(n):
        if s[i] == '7':
            # Choose the smallest possible character that minimizes the cost
            # We can choose 'a' as it is the lexicographically smallest
            s[i] = 'a'
    return ''.join(s)

# Example usage:
print(minimize_string_value("???"))  # Output: "abc"
print(minimize_string_value("n>n"))   # Output: "abc"