input: Write a python function that takes a list of non-empty strings and returns a list of the smallest substrings that are unique to each original string. If there are several candidates for the shortest substring, return the lexicographically smallest one. If no such unique substring exists, return an empty string.
output: def smallest_unique_substrings(strings):
      def unique_substring(s, substrings):
          for length in range(1, len(s) + 1):
              unique_substrings = sorted(set(s[i:i+length] for i in range(len(s)-length+1) if s[i:i+length] not in substrings))
              if unique_substrings:
                  return unique_substrings[0]
          return ""
  
      substrings = {}
      for s in strings:
          for length in range(1, len(s) + 1):
              for i in range(len(s) - length + 1):
                  substr = s[i:i+length]
                  if substr in substrings:
                      substrings[substr] += 1
                  else:
                      substrings[substr] = 1
  
      result = []
      for s in strings:
          result.append(unique_substring(s, {key for key, value in substrings.items() if value > 1}))
  
      return result