#include <iostream>
#include <functional>

using namespace std;

int main() {
	// your code goes here
	std::function<void()> a, b;
	a = [&]() {
		static bool call = true;
		cout << "a called" << endl;
		if(call) {
			call = false;
			b();
		}
	};
	
	b = [&]() {
		static bool call = true;
		cout << "b called" << endl;
		if(call) {
			call = false;
			a();
		}
	};
	
	a();

	return 0;
}