#include<iostream.h>
void main()
{
int b,f,nrf=0,nrb=0,d=0,aux1,aux2;
cout<<"b:"; cin>>b;
cout<<"f:"; cin>>f;
aux1=b;
aux2=f;
while(aux1!=aux2)
{
if(aux1<aux2)
aux2=aux2-aux1;
else
aux1=aux1-aux2;
}
d=aux1;
if(d<2)
cout<<"nu ne putem juca";
else
cout<<d<<" echipe cu "<<b/d<<" baieti si "<<f/d<<" fete";
}