// HelloWorld.cpp by Matteo Italia

#include <iostream>
#include <string>
#include <new>

namespace HelloLand
{
    template<int Ordinal=1> class Hello
    {
        private:
            Hello<Ordinal<<1> * next;

            // We don't want no damned copies
            Hello(const Hello<Ordinal> & Other) {}
            Hello<Ordinal>& operator=(const Hello<Ordinal>& Other) {}
        public:

            Hello()
            {
                next=new Hello<Ordinal<<1>;
            }

            ~Hello()
            {
                delete next;
            }


            std::string GetString()
            {
                return next->GetString() + GetChar();
            }

            char GetChar();
    };

    template <> char Hello<1<<0>::GetChar() { return '!'; }
    template <> char Hello<1<<1>::GetChar() { return 'd'; }
    template <> char Hello<1<<2>::GetChar() { return 'l'; }
    template <> char Hello<1<<3>::GetChar() { return 'r'; }
    template <> char Hello<1<<4>::GetChar() { return 'o'; }
    template <> char Hello<1<<5>::GetChar() { return 'w'; }
    template <> char Hello<1<<6>::GetChar() { return ' '; }
    template <> char Hello<1<<7>::GetChar() { return 'o'; }
    template <> char Hello<1<<8>::GetChar() { return 'l'; }
    template <> char Hello<1<<9>::GetChar() { return 'l'; }
    template <> char Hello<1<<10>::GetChar() { return 'e'; }
    template <> char Hello<1<<11>::GetChar() { return 'H'; }

    template<> class Hello<1<<12>
    {
        public:
        std::string GetString()
        {
            return "";
        }
    };
}

int main()
{
    HelloLand::Hello<> hello;
    std::cout<<hello.GetString()<<std::endl;
    return 0;
}
