#include <iostream>
#include <memory>
#include <vector>
#include <cstdint>
using namespace std;

enum shape_kind {Cube, Sphere};

struct shape {
	virtual ~shape() {}
	virtual shape_kind kind() = 0;
};

struct cube : public shape {
	shape_kind kind() { return Cube; }
};
struct sphere : public shape {
	shape_kind kind() { return Sphere; }
};

shared_ptr<shape> parse(const vector<uint8_t> data) {
	if (data.at(0) == 1) {
		return shared_ptr<shape>(new sphere);
	} else {
		return shared_ptr<shape>(new cube);
	}
}

int main() {
	vector<uint8_t> x {1};
	vector<uint8_t> y {2};
	auto s = parse(x);
	auto c = parse(y);
	cout << (*s).kind() << endl;
	cout << (*c).kind() << endl;
	return 0;
}