#include <cstdlib>
#include <iostream>

using namespace std;

int mcd(int a, int b)
{
    if (b==0)
       return a;
    else
       return mcd(b, a%b);
}


int main(int argc, char *argv[])
{
    cout << mcd(12,18) << endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
