func (r SortedStringToStringMap) Select(key int) (k string, v string, ok bool) {
	x := r.nodeselect(r.root, key)
	if x == nil {
		return
	}
	return x.key, x.val, true
}
Select key of rank k, meaning the k-th biggest string in the sorted map.
package codegen
func (r SortedStringToStringMap) compare(a, b string) int {
    if a < b {
        return -1
    }
    if a > b {
        return 1
    }
    return 0
}
type SortedStringToStringMap struct {
	root *nodeStringToString
}
func NewSortedStringToStringMap() *SortedStringToStringMap { return &SortedStringToStringMap{} }
func (r SortedStringToStringMap) IsEmpty() bool {
	return r.root == nil
}
func (r SortedStringToStringMap) Size() int { return r.root.size() }
func (r *SortedStringToStringMap) Clear() { r.root = nil }
func (r *SortedStringToStringMap) Put(k string, v string) (old string, overwrite bool) {
	r.root, old, overwrite = r.put(r.root, k, func() string { return v }, func(_ string) string { return v })
	return
}
func (r *SortedStringToStringMap) Mutate(k string, creator func() string, mutator func(old string) string) {
	r.root, _, _ = r.put(r.root, k, creator, mutator)
}
func (r *SortedStringToStringMap) put(h *nodeStringToString, k string, create func() string, mutate func(old string) string) (_ *nodeStringToString, old string, overwrite bool) {
	if h == nil {
		n := &nodeStringToString{key: k, val: create(), n: 1, colorRed: true}
		return n, old, overwrite
	}
	cmp := r.compare(k, h.key)
	if cmp < 0 {
		h.left, old, overwrite = r.put(h.left, k, create, mutate)
	} else if cmp > 0 {
		h.right, old, overwrite = r.put(h.right, k, create, mutate)
	} else {
		overwrite = true
		old = h.val
		h.val = mutate(old)
	}
	if h.right.isRed() && !h.left.isRed() {
		h = r.rotateLeft(h)
	}
	if h.left.isRed() && h.left.left.isRed() {
		h = r.rotateRight(h)
	}
	if h.left.isRed() && h.right.isRed() {
		r.flipColors(h)
	}
	h.n = h.left.size() + h.right.size() + 1
	return h, old, overwrite
}
func (r SortedStringToStringMap) Get(k string) (string, bool) {
	return r.loopGet(r.root, k)
}
func (r SortedStringToStringMap) loopGet(h *nodeStringToString, k string) (v string, ok bool) {
	for h != nil {
		cmp := r.compare(k, h.key)
		if cmp == 0 {
			return h.val, true
		} else if cmp < 0 {
			h = h.left
		} else if cmp > 0 {
			h = h.right
		}
	}
	return
}
func (r SortedStringToStringMap) Has(k string) bool {
	_, ok := r.loopGet(r.root, k)
	return ok
}
func (r SortedStringToStringMap) Min() (k string, v string, ok bool) {
	if r.root == nil {
		return
	}
	h := r.min(r.root)
	return h.key, h.val, true
}
func (r SortedStringToStringMap) min(x *nodeStringToString) *nodeStringToString {
	if x.left == nil {
		return x
	}
	return r.min(x.left)
}
func (r SortedStringToStringMap) Max() (k string, v string, ok bool) {
	if r.root == nil {
		return
	}
	h := r.max(r.root)
	return h.key, h.val, true
}
func (r SortedStringToStringMap) max(x *nodeStringToString) *nodeStringToString {
	if x.right == nil {
		return x
	}
	return r.max(x.right)
}
func (r SortedStringToStringMap) Floor(key string) (k string, v string, ok bool) {
	x := r.floor(r.root, key)
	if x == nil {
		return
	}
	return x.key, x.val, true
}
func (r SortedStringToStringMap) floor(h *nodeStringToString, k string) *nodeStringToString {
	if h == nil {
		return nil
	}
	cmp := r.compare(k, h.key)
	if cmp == 0 {
		return h
	}
	if cmp < 0 {
		return r.floor(h.left, k)
	}
	t := r.floor(h.right, k)
	if t != nil {
		return t
	}
	return h
}
func (r SortedStringToStringMap) Ceiling(key string) (k string, v string, ok bool) {
	x := r.ceiling(r.root, key)
	if x == nil {
		return
	}
	return x.key, x.val, true
}
func (r SortedStringToStringMap) ceiling(h *nodeStringToString, k string) *nodeStringToString {
	if h == nil {
		return nil
	}
	cmp := r.compare(k, h.key)
	if cmp == 0 {
		return h
	}
	if cmp > 0 {
		return r.ceiling(h.right, k)
	}
	t := r.ceiling(h.left, k)
	if t != nil {
		return t
	}
	return h
}