Design and implement an autocomplete system. The system should be initialized with a list of words (e.g., product names or dictionary words). As a user types a query string character by character, the system should return up to three suggested words from the original list that start with the current query prefix, sorted in lexicographical order.
Requirements:
Example:
Assume the initial word list is: ["apple", "app", "apricot", "banana", "bat", "bath", "batman"]
For the query string: "ba"
The function should return:
[
["banana", "bat", "bath"], // suggestions after 'b'
["banana", "bat", "bath"] // suggestions after 'ba'
]
Develop a solution in the programming language of your choice and ensure that your code handles edge cases effectively.