#include <bits/stdc++.h>
using namespace std;
long long mPn(long long m, long long n) {
  long long a = 1;
  for (int i = 0; i < n; i++) {
    a *= m - i;
  }
  return a;
}
long long exc(long long m) {
  long long a = 1;
  for (int i = (int)(1); i < (int)(m); i++) {
    a *= i + 1;
  }
  return a;
}
long long mCn(long long m, long long n) {
  long long a = 1, b = 1;
  for (int i = 0; i < n; i++) {
    a *= m - i;
    b *= n - i;
  }
  return a / b;
}
int main() {
  int a[5], k;
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
  int total = 0;
  int bm = 0;
  for (int i = 0; i < 5; i++) {
    int b = 0;
    if (a[i] % 10 != 0) {
      int aa = a[i] % 10;
      if (10 - aa > bm) {
        bm = 10 - aa;
      }
      b = a[i] - aa + 10;
    } else {
      b = a[i];
    }
    cout << b << endl;
    total += b;
  }
  cout << total - bm << endl;
  return 0;
}
