<s>[INST] def smallest_substring(s, sub):
    if not s or not sub:
        return -1
    sub_count = {}
    for c in sub:
        if c not in sub_count:
            sub_count[c] = 0
        sub_count[c] += 1

    required_chars = len(sub_count)
    formed_chars = 0
    start = 0
    ans = float('inf')
    ans_str = ""

    for end in range(len(s)):
        if s[end] in sub_count:
            sub_count[s[end]] -= 1
            if sub_count[s[end]] == 0:
                formed_chars += 1

        while start <= end and required_chars == formed_chars:
            if end - start + 1 < ans:
                ans = end - start + 1
                ans_str = s[start:end + 1]

            if s[start] in sub_count:
                if sub_count[s[start]] == 0:
                    formed_chars -= 1
                sub_count[s[start]] += 1
            start += 1

    return -1 if ans == float('inf') else ans[/INST]