#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

class BizzElem{
	int N_;
	std::string Str_;
	bool Enable_;
public:
	BizzElem(const int& Number, std::string Out, bool Enable = true) :N_(Number), Str_(Out), Enable_(Enable){};

	bool Do(const int& i){
		if (Enable_ == false) return false;
		if (i == 0) return false;
		if (i%N_== 0){
			std::cout << Str_ << ',';
			return true;
		}
		return false;
	}

	int N(){
		return N_;
	}

	std::string String(){
		return Str_;
	}

	bool IsEnable(){
		return Enable_;
	}
	bool ToMoveable(bool IsMove){
		Enable_ = IsMove;
		return Enable_;
	}
};

class FizzBizz{
	std::vector<BizzElem> Vec_;

public:

	FizzBizz(){};

	bool Append(const BizzElem& BE){
		Vec_.push_back(BE);
		return true;
	}

	bool operator ()(const int& N){
		bool F = false;

		for (auto& o : Vec_){
			F |= o.Do(N);
		}
		if (F == true) std::cout<< std::endl;
		if (F == false) std::cout << N << std::endl;

		return F;
	}

	BizzElem& Find(std::string Name){
		static BizzElem NotFind(0, "NotFind!");


		for (auto& o : Vec_) if (o.String() == Name) return o;

		return NotFind;
	}

};

int main(){
	FizzBizz FB;

	FB.Append(BizzElem(3, "Fizz"));
	FB.Append(BizzElem(5, "Bizz"));
	FB.Append(BizzElem(7, "Gizz"));
	std::cout << 1 << ':';FB(1);
	std::cout << 3 << ':';FB(3);
	std::cout << 5 << ':';FB(5);
	std::cout << 7 << ':';FB(7);
	std::cout << 21 << ':';FB(21);
	std::cout << 35 << ':';FB(35);
	std::cout << 105 << ':';FB(105);
	std::swap(FB.Find("Gizz"), FB.Find("Bizz"));
	std::cout << 105 << ':';FB(105);
	std::swap(FB.Find("Gizz"), FB.Find("Bizz"));
	std::cout << 997 << ':';FB(997);
	std::cout << 999 << ':';FB(999);

	std::cout << "------List Of 50------" << std::endl;

	for (int i = 0; i < 50; i++) FB(i);



	return 0;
}