#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[5];
  int min = 299;
  int minIndex = 0;
  for (int i = 0; i < 5; i++) {
    cin >> A[i];
    if (A[i] % 10 != 0 && min % 10 > A[i] % 10) {
      min = A[i];
      minIndex = i;
    }
  }
  int ret = 0;
  for (int i = 0; i < 5; i++) {
    if (i == minIndex) {
      ret += A[i];
    } else if (A[i] % 10 == 0)
      ret += A[i];
    else {
      ret += (A[i] / 10) * 10;
      ret += 10;
    }
    cout << ret << endl;
  }
  cout << ret << endl;
}
void cheatsheet() {
  vector<int> vecloop;
  for (int i = 0; i < 10; i++) {
    vecloop.push_back(i);
  }
  int a = 1;
  int b = 5;
  swap(a, b);
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  sort(arr, arr + 9, greater<int>());
  vector<int> vec(arr, end(arr));
  sort(vec.begin(), vec.end());
  cout << lower_bound(vec.begin(), vec.end(), 2)[0];
  map<pair<long long, long long>, long long> m;
  m[pair<long long, long long>(10, 100)] = 100;
}
