#include <cstddef>
#include <iostream>
template <typename T> struct Printable
{
Printable(const T& val) : val(val) {}
void print(std::ostream& out) const {out << val;}
const T& val;
};
template <> struct Printable<std::nullptr_t>
{
Printable(nullptr_t) {}
void print(std::ostream& out) const {out << "null";}
};
template <typename T>
Printable<T> printable(const T& value) {return Printable<T>(value);}
template <typename T>
std::ostream& operator<<(std::ostream& out, const Printable<T>& p)
{
p.print(out);
return out;
}
int main()
{
std::cout << printable(42) << " " << printable(nullptr) << "\n";
return 0;
}
I2luY2x1ZGUgPGNzdGRkZWY+CiNpbmNsdWRlIDxpb3N0cmVhbT4KCnRlbXBsYXRlIDx0eXBlbmFtZSBUPiBzdHJ1Y3QgUHJpbnRhYmxlCnsKICAgIFByaW50YWJsZShjb25zdCBUJiB2YWwpIDogdmFsKHZhbCkge30KICAgIHZvaWQgcHJpbnQoc3RkOjpvc3RyZWFtJiBvdXQpIGNvbnN0IHtvdXQgPDwgdmFsO30KICAgIGNvbnN0IFQmIHZhbDsKfTsKCnRlbXBsYXRlIDw+IHN0cnVjdCBQcmludGFibGU8c3RkOjpudWxscHRyX3Q+CnsKICAgIFByaW50YWJsZShudWxscHRyX3QpIHt9CiAgICB2b2lkIHByaW50KHN0ZDo6b3N0cmVhbSYgb3V0KSBjb25zdCB7b3V0IDw8ICJudWxsIjt9Cn07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KUHJpbnRhYmxlPFQ+IHByaW50YWJsZShjb25zdCBUJiB2YWx1ZSkge3JldHVybiBQcmludGFibGU8VD4odmFsdWUpO30KCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpzdGQ6Om9zdHJlYW0mIG9wZXJhdG9yPDwoc3RkOjpvc3RyZWFtJiBvdXQsIGNvbnN0IFByaW50YWJsZTxUPiYgcCkKewogICAgcC5wcmludChvdXQpOwogICAgcmV0dXJuIG91dDsKfQoKaW50IG1haW4oKQp7CglzdGQ6OmNvdXQgPDwgcHJpbnRhYmxlKDQyKSA8PCAiICIgPDwgcHJpbnRhYmxlKG51bGxwdHIpIDw8ICJcbiI7CglyZXR1cm4gMDsKfQ==