Implement a class that maintains the mean, median, and mode of a stream of numbers in O(1) time.
Assume values are integers, numbers are added incrementally, and queries may request all three statistics after any insertion; if the requirement is impossible under the stated model, explain why and provide the closest exact implementation.
For grading, process operations such as ["add", 5] and ["query"], returning [mean, median, mode]; break mode ties by choosing the smallest value.
def stream_statistics(operations):