#include <iostream>

using namespace std;

int main(){

int a,b,pom;
	
 cout << "Podaj liczbe a: ";

 cin >> b;

 while (b!=0){

	pom = a % b;

	a = b;
		
	b = pom;

 }

cout << "Najwiekszy wspolny dzielnik: " << a << endl;

}