A stastistic stack based on red-black tree, which supports operations of pop, push, top, and getting max, min, and kth small element randomly, and achive a time complexity of O(lgn) in general.