Implement data structures and APIs to store file names and support efficient queries that match both a given prefix and suffix. Provide methods add(name: string) and find(prefix: string, suffix: string) -> list of names (or IDs) that match both constraints, returning results in lexicographic order. Support up to 100,000 insertions and many queries with near-real-time updates; analyze time and space complexity and discuss alternatives (e.g., two tries, suffix automaton, inverted indexes).