#include<iostream>
#include<conio.h>
using namespace std;
class BozorgtarinMaghsumMoshtarakClass
{
	public :
		int x, y;
		int IsMaghsum(int num)
		{
			if(x % num == 0 && y % num == 0)
				return 1;
			else
				return 0;
		}
};

int main()
{
	BozorgtarinMaghsumMoshtarakClass A;
	int i;
	cout << "2 adade vorodi ra be tartib vared konid : ";
	cin >> A.x >> A.y;
	for(i = A.x; i > 0; i--)
		if(A.IsMaghsum(i) == 1)
			break;
	cout << "bozorgtarin maghsum alayh moshtarak = " << i << endl;
	getch();
}

