#include <iostream>

using namespace std;

/* Actions definitions */
template<typename Interface>
struct A1 {
	void print() {
		cout << "A1 - ";
		Interface i;
		i.print();
	}
};

template<typename Interface>
struct A2 {
	void print() {
		cout << "A2 - ";
		Interface i;
		i.print();
	}
};

/* Interfaces definitions */
struct I1 {
	void print() {
		cout << "I1\n";
	}
};
struct I2 {
	void print() {
		cout << "I2\n";
	}
};

/* Loop start (no loop now) */
template<
  class Interface,
  template<typename I> class Action1,
  template<typename I> class ... Actions
>
void g() {
	cout << "First Action<Interface>\n";
	Action1<Interface> action;
	action.print();
}

/* Starting function */
template<class Interface, template<typename I> class ... Actions>
void f()
{
	g<Interface, Actions...>();
}

/* Main */
int main()
{
	f<I1, A1, A2>();
	return 0;
}