You are coordinating a cluster of simulated worker nodes. Each node holds a local list of integer measurements, and every measurement is guaranteed to be an integer in the inclusive range [lo, hi]. Your job is to compute two global statistics over the union of all measurements held by every node:
Because the cluster operates under a tight bandwidth budget, you cannot ship every raw measurement to a single coordinator. You must aggregate compact per-node summaries and combine them. The width of the value range (hi - lo + 1) may be much smaller than the total number of measurements.
Implement the function distributed_stats(nodes, lo, hi) where nodes is a list of lists of integers (one inner list per node). Return a tuple (mode, median) where mode is an int and median is a float. You may assume there is at least one measurement in total.