#include <string>
#include <exception>
#include <cctype>
#include <vector>
#include <unordered_map>
class Worker {
public:
	class IncorrectData: public std::exception {};
	friend class Accountant;
private:
	 std::string name_;
	 std::string surname_;
	 std::string otch_;
	int salary_;
protected:
	int id_;
public:
	
	Worker(const std::string& name, const std::string& surname, const std::string& otch, int salary = 0) : name_(name), surname_(surname), otch_(otch), salary_(salary), id_(0) {
		for (size_t i = 0; i < name.size(); ++i) {
			if (std::isalpha(name[i]) == 0) {
				throw IncorrectData();
			}
		}
		for (size_t i = 0; i < surname.size(); ++i) {
			if (std::isalpha(surname[i]) == 0) {
				throw IncorrectData();
			}
		}
		for (size_t i = 0; i < otch.size(); ++i) {
			if (std::isalpha(otch[i]) == 0) {
				throw IncorrectData();
			}
		}
		if (salary < 0) {
			throw IncorrectData();
		}
	}
	std::string GetName() {
		return name_;
	}
	std::string GetSurame() {
		return surname_;
	}
	std::string GetOtch() {
		return otch_;
	}
	int GetSalary() {
		return salary_;
	}
	void SetName(const std::string name) {
		for (size_t i = 0; i < name.size(); ++i) {
			if (std::isalpha(name[i]) == 0) {
				throw IncorrectData();
			}
		}
		name_ = name;
	}
	void SetSurame(const std::string surname) {
		for (size_t i = 0; i < surname.size(); ++i) {
			if (std::isalpha(surname[i]) == 0) {
				throw IncorrectData();
			}
		}
		surname_ = surname;
	}
	void SetOtch(const std::string otch) {
		for (size_t i = 0; i < otch.size(); ++i) {
			if (std::isalpha(otch[i]) == 0) {
				throw IncorrectData();
			}
		}
		otch_ = otch;
	}
	void SetSalary(int salary) {
		if (salary_ < 0) {
			throw IncorrectData();
		}
		salary_ = salary;
	}
	
};
class Guard: public virtual Worker {
	friend class Accountant;
private:
	std::string special_instrument_;
public:
	Guard(const std::string& name, const std::string& surname, const std::string& otch, const std::string& special_instrument, int salary = 0) : Worker(name, surname, otch, salary), special_instrument_(special_instrument){
		for (size_t i = 0; i < special_instrument.size(); ++i) {
			if (std::isalpha(special_instrument[i]) == 0) {
				throw IncorrectData();
			}
		}
		id_= 1;
	}
	std::string GetSpecialInstrument() {
		return special_instrument_;
	}
	void SetSpecialInstrument(const std::string special_instrument) {
		for (size_t i = 0; i < special_instrument.size(); ++i) {
			if (std::isalpha(special_instrument[i]) == 0) {
				throw IncorrectData();
			}
		}
		special_instrument_ = special_instrument;
	}
	};
class Driver: public virtual Worker { 
	friend class Accountant;
private:
	std::vector<std::string> licenses_;
	std::vector<std::string> transport_;
public:
	Driver(const std::string& name, const std::string& surname, const std::string& otch, std::vector<std::string>& licenses, std::vector<std::string>& transport, int salary = 0) : Worker(name, surname, otch, salary), licenses_(licenses), transport_(transport) {
		for (auto license : licenses) {
			for (size_t i = 0; i < license.size(); ++i) {
				if (std::isalpha(license[i]) == 0) {
					throw IncorrectData();
				}
			}
		}
		for (auto transp : transport) {
			for (size_t i = 0; i < transp.size(); ++i) {
				if (std::isalpha(transp[i]) == 0) {
					throw IncorrectData();
				}
			}
		}
		id_ = 2;
	}
	std::vector<std::string> GetTransport() {
		return transport_;
	}
	void SetTransport(const std::vector<std::string>transport) {
		for (auto transp : transport) {
			for (size_t i = 0; i < transp.size(); ++i) {
				if (std::isalpha(transp[i]) == 0) {
					throw IncorrectData();
				}
			}
		}
		transport_ = transport;
	}
	std::vector<std::string> GetLicenses() {
		return licenses_;
	}
	void SetLicenses(const std::vector<std::string>licenses) {
		for (auto license : licenses) {
			for (size_t i = 0; i < license.size(); ++i) {
				if (std::isalpha(license[i]) == 0) {
					throw IncorrectData();
				}
			}
		}
		licenses_ = licenses;
	}
};
class Accountant: public virtual Worker {
private:
	std::unordered_map<int, int> salaries_;
public:
	Accountant(const std::string& name, const std::string& surname, const std::string& otch, std::vector<std::string>& licenses, int salary = 0) : Worker(name, surname, otch, salary) {
		salaries_[0] = 0;
		salaries_[1] = 100;
		salaries_[2] = 100;
		salaries_[3] = 200;
		id_ = 3;
	}
	void SetWorkerSalary(Worker& worker) {
		worker.SetSalary(salaries_[worker.id_]);
 }
	void SetSalary(int salary, int id) {
		if (salary < 0) {
			throw IncorrectData();
		}
		salaries_[id] = salary;
	}
	int GetSalary(int id) {
		return salaries_[id];
	}
};
class Salary {
private:
	int salary;
public:
};
class Initials {
private:
	std::string initials;
};
class WorkerInfo: public Salary, public Initials {

};