#include <iostream>
#include <list>
template <class T1, class T2>
class FirstClass
{
public:
FirstClass (T1 & a, T2 & b);
};
template <class T1, class T2, class T3>
class SecondClass
{
public:
SecondClass (T1 & a, T2 & b, T3 & c);
};
template<class T1, class T2, class T3 = FirstClass<T1, T2>>
class FirstPool
{
std::list <T3> Objects;
T1 aa;
T2 bb;
public:
FirstPool (T1 & a, T2 & b) : aa (a), bb (b) {}
};
template<class T1, class T2, class T3>
class SecondPool : FirstPool<T1, T2, SecondClass<T1, T2, T3>>
{
T3 cc;
public:
SecondPool (T1 & a, T2 & b, T3 & c)
: FirstPool<T1, T2, SecondClass<T1, T2, T3>>(a, b)
, cc (c)
{}
};
int main() {
// your code goes here
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGlzdD4KCnRlbXBsYXRlIDxjbGFzcyBUMSwgY2xhc3MgVDI+CmNsYXNzIEZpcnN0Q2xhc3MKewpwdWJsaWM6CiBGaXJzdENsYXNzIChUMSAmIGEsIFQyICYgYik7Cn07Cgp0ZW1wbGF0ZSA8Y2xhc3MgVDEsIGNsYXNzIFQyLCBjbGFzcyBUMz4KY2xhc3MgU2Vjb25kQ2xhc3MKewpwdWJsaWM6CiBTZWNvbmRDbGFzcyAoVDEgJiBhLCBUMiAmIGIsIFQzICYgYyk7Cn07Cgp0ZW1wbGF0ZTxjbGFzcyBUMSwgY2xhc3MgVDIsIGNsYXNzIFQzID0gRmlyc3RDbGFzczxUMSwgVDI+PgpjbGFzcyBGaXJzdFBvb2wKewoJc3RkOjpsaXN0IDxUMz4gT2JqZWN0czsKCVQxIGFhOwoJVDIgYmI7CgpwdWJsaWM6CglGaXJzdFBvb2wgKFQxICYgYSwgVDIgJiBiKSA6IGFhIChhKSwgYmIgKGIpIHt9Cn07Cgp0ZW1wbGF0ZTxjbGFzcyBUMSwgY2xhc3MgVDIsIGNsYXNzIFQzPgpjbGFzcyBTZWNvbmRQb29sIDogRmlyc3RQb29sPFQxLCBUMiwgU2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