private Gen<T> pick(int pos, int sought)
    {
        int interval = generatorPairs[pos].fst();
        if (interval <= sought) {
            return generatorPairs[pos].snd();
        }
        else {
            return pick(pos+1, sought-interval);
        }
    }