#include <iostream>

    template<class T>struct identity{using type=T;};

    template <typename T, template<class>class Z=identity>
    struct Yin {
      template<class U>using Z_t=typename Z<U>::type;
      Z_t<T> *m_ptr;
    };

    template <typename T, template<class>class Z=identity>
    struct Yang {
      template<class U>using Z_t=typename Z<U>::type;
      Z_t<T> *m_ptr;
    };

    template<
      template<class, template<class>class>class Yin,
      template<class, template<class>class>class Yang
    >
    struct flopper {
      template<class T> struct flip {
        using type = Yang<T, flopper<Yang, Yin>::template flip>;
      };
    };

    using ying = Yin< void, flopper<Yin, Yang>::template flip >;
    using yang = Yang< void, flopper<Yang, Yin>::template flip >;


int main() {
	ying a = {nullptr};
	yang b = {&a};
	
	// your code goes here
	return 0;
}