#include <iostream>
using namespace std;

class Yoba{
};

class Yoba1{
	Yoba1(char l){}
};

class Yoba2{
	Yoba2(int l){}
};

template<typename T>
Yoba foo(int type, T val) {
switch(type) {
case 0 : return new Yoba1(val);
case 1 : return new Yoba2(val);
}
}


int main() {
	// your code goes here
	return 0;
}