#include <iostream>
using namespace std;

template<const char* s = "hello">
class A {
public:
	void foo();
};

template<const char* s>
void A<s>::foo() {
	cout << s;
}

typedef A<" world"> B;

class C : public A<"!\n"> {};

int main() {
	A<"hello"> a;
	B b;
	C c;
	a.foo();
	b.foo();
	c.foo();
	return 0;
}