#include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, ans = 0;
cin >> a >> b >> c >> d >> e;
a /= 3, ans += a % 3, b += a, e += a;
b /= 3, ans += b % 3, c += b, a += b;
c /= 3, ans += c % 3, d += c, b += c;
d /= 3, ans += d % 3, e += d, c += d;
e /= 3, ans += e % 3, a += e, d += e;
cout << a << " " << b << " " << c << " " << d << " " << e;
cout << endl << ans;
return 0;
}
好像是ans不对