#include <iostream>

using namespace std;

int main(){
	int a, b, c, res, min_numb;

	cout << "Input numbers: " << endl;

	cin >> a >> b >> c;

	if ((a == 0) || (b == 0) || (c == 0)){
		cout << "0 has no greatest common divisor" << endl;
		return 0;
	}

	if (a > b){
		if (b > c){
			min_numb = c;
		}
		else {
			min_numb = b;
		}
	}
	else {
		if (a > c){
			min_numb = c;
		}
		else {
			min_numb = a;
		}
	}

	for (int i = 1; i <= abs(min_numb); i++){
		if ((a % i == 0) && (b % i == 0) && (c % i == 0)){
			res = i;
		}
	}

	cout << "Result: " << res << endl;
	
	return 0;
}
