#include <iostream>
#include <iomanip>
usingnamespace std;
int main(){
int a, aa, b, c, d, x = 0;
cout << "Enter four numbers: ";
cin >> a >> b >> c >> d;
cout << endl;
while(a != b && a != c && a != d ){
aa = a;
a -= b;
b -= c;
c -= d;
d -= aa;
x++;
if(a < 0)
a *= -1;
if(b < 0)
b *= -1;
if(c < 0)
c *= -1;
if(d < 0)
d *= -1;
}
cout << "This group converges to value " << a << " after " << x << " steps.";
}