#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double ax, ay, az, bx, by, bz, mdla, mdlb, mdlab, ccos, ugl;
int gr = 0,mn=0, sc=0;
cin >> ax >> ay >> az >> bx >> by >> bz;
mdla = sqrt(ax*ax + ay*ay + az*az); //формула длины вектора
mdlb = sqrt(bx*bx + by*by + bz*bz);
mdlab = mdla*mdlb;
ccos = (ax*bx + ay*by + az*bz) / mdlab; // формула косинус угла между векторами
ugl = acos(ccos)*180/M_PI;// получим угол по формуле перевода радиан в градусы
gr = (int)ugl;
ugl -= gr;
while (ugl < 0.1)ugl *= 10;
mn =(int)( ugl /(1.0/60.0) );
ugl -= mn*(1.0 / 60.0);
while (ugl < 0.1)ugl *= 10;
sc = (int)(ugl/(1.0/60));
cout << gr << "° " << mn << "' " << sc << "''";
return 0;
}
I2RlZmluZSBfVVNFX01BVEhfREVGSU5FUyAKI2luY2x1ZGUgPGlvc3RyZWFtPiAKI2luY2x1ZGUgPGNtYXRoPiAKdXNpbmcgbmFtZXNwYWNlIHN0ZDsgCgppbnQgbWFpbigpIHsgCmRvdWJsZSBheCwgYXksIGF6LCBieCwgYnksIGJ6LCBtZGxhLCBtZGxiLCBtZGxhYiwgY2NvcywgdWdsOyAKaW50IGdyID0gMCxtbj0wLCBzYz0wOyAKY2luID4+IGF4ID4+IGF5ID4+IGF6ID4+IGJ4ID4+IGJ5ID4+IGJ6OyAKbWRsYSA9IHNxcnQoYXgqYXggKyBheSpheSArIGF6KmF6KTsgLy/RhNC+0YDQvNGD0LvQsCDQtNC70LjQvdGLINCy0LXQutGC0L7RgNCwIAptZGxiID0gc3FydChieCpieCArIGJ5KmJ5ICsgYnoqYnopOyAKbWRsYWIgPSBtZGxhKm1kbGI7IAoKY2NvcyA9IChheCpieCArIGF5KmJ5ICsgYXoqYnopIC8gbWRsYWI7IC8vINGE0L7RgNC80YPQu9CwINC60L7RgdC40L3Rg9GBINGD0LPQu9CwINC80LXQttC00YMg0LLQtdC60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