#include <bits/stdc++.h>
int main(void) {
  int a[5], b[5], lastorder, rest, i, pos, ans;
  lastorder = 0;
  pos = 10;
  scanf("%d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &a[4]);
  for (i = 0; i < 5; i++) {
    if (a[i] % 10 != 0) {
      b[i] = ((a[i] + 10) / 10) * 10;
    } else {
      b[i] = a[i];
    }
  }
  for (i = 0; i < 5; i++) {
    rest = a[i] % 10;
    if (rest != 0 && rest < pos) {
      lastorder = a[i];
    }
    pos = rest;
  }
  if (lastorder == 0) {
    ans = a[0] + a[1] + a[2] + a[3] + a[4];
  } else {
    ans = b[0] + b[1] + b[2] + b[3] + b[4] - ((lastorder + 10) / 10) * 10 +
          lastorder;
  }
  printf("%d\n", ans);
  for (i = 0; i < 5; i++) {
    printf("%d\n", b[i]);
  }
}
