Shortened Treap code.