#include <bits/stdc++.h>
using namespace std;
using namespace std;
const long long MAX = 510000;
const long long MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
long long jousu(long long x00, long long y00) {
  long long z00 = 1;
  for (long long i = 0; i < y00; i++) {
    z00 *= x00;
  }
  return z00;
}
long long keta(long long x00) {
  long long z00 = x00;
  long long w00 = 0;
  while (z00 != 0) {
    z00 /= 10;
    w00++;
  }
  return w00;
}
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
long long modpow(long long a, long long n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res* a % 1000000007;
    a = a * a % 1000000007;
    n >>= 1;
  }
  return res;
}
long long gcd(long long xx, long long yy) {
  long long p = xx;
  long long q = yy;
  if (q > p) swap(p, q);
  while (p % q != 0) {
    p %= q;
    swap(p, q);
  }
  return q;
}
long long lcm(long long xx, long long yy) { return xx * yy / gcd(xx, yy); }
bool prime(long long xx) {
  long long a = xx;
  for (long long i = 2; i * i <= xx; i++) {
    if (xx % i == 0) {
      return 0;
    }
  }
  return 1;
}
long long com(long long xx, long long yy) {
  long long zz = 1;
  for (long long i = xx; i > xx - yy; i--) {
    zz *= i;
    zz %= 1000000007;
  }
  for (long long i = 1; i <= yy; i++) {
    zz *= modinv(i, 1000000007);
    zz %= 1000000007;
  }
  return zz;
}
signed main() {
  long long a, b = 10, t = 0;
  for (long long i = 0; i < (long long)(5); i++) {
    cin >> a;
    if ((a + 9) % 10 <= (b + 9) % 10) {
      b = a;
    }
    t += (a + 9) / 10 * 10;
    cout << (a + 9) / 10 * 10 << " ";
  }
  cout << b << "\n";
  cout << t - (b + 9) / 10 * 10 + b << "\n";
}
