#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int aa = (a % 10 == 0 ? a : (a / 10 + 1) * 10);
  int bb = (b % 10 == 0 ? b : (b / 10 + 1) * 10);
  int cc = (c % 10 == 0 ? c : (c / 10 + 1) * 10);
  int dd = (d % 10 == 0 ? d : (d / 10 + 1) * 10);
  int ee = (e % 10 == 0 ? e : (e / 10 + 1) * 10);
  int diff = std::max({aa - a, bb - b, cc - c, dd - d, ee - e});
  cout << aa + bb + cc + dd + ee - diff << endl;
  cout << aa << endl;
  cout << bb << endl;
  cout << cc << endl;
  cout << dd << endl;
  cout << ee << endl;
  cout << diff;
  return 0;
}
