
//extern const char example[] = "the only kind of thing that will work";

struct STRING{
    template <const char * const TEXT, int S>
    struct STR{
        static inline const int SIZE()
        {
            return S;
        }
        static inline const char PEEK(const int N)
        {
            if (N>=S)
                return 0;
            return *(TEXT+N);
        }
    };


    template <typename S, int BEGIN, int END>
    struct SUB{
        static inline const int SIZE()
        {
            return END-BEGIN;
        }
        static inline const char PEEK(const int N)
        {
            if (N > END-BEGIN)
                return 0;
            return S::PEEK(N+BEGIN);
        }
    };

    template <typename S, int BEGIN, int END, typename S2>
    struct INSERT{
        static inline const int SIZE()
        {
            return S::SIZE()-(END-BEGIN)+S2::SIZE()+1;
        }
        static inline const char PEEK(const int N)
        {
            if (N<BEGIN)
                return S::PEEK(N);
            if (N-BEGIN < S2::SIZE())
                return S2::PEEK(N-BEGIN);
            return S::PEEK(N-S2::SIZE()+(END-BEGIN));
        }
    };

    template <typename S>
    static inline void REDUCE(char arr[])
    {
        for(int i=0;i<S::SIZE();i++)
            arr[i] = S::PEEK(i);
    }
    
};
