#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

def main():
    ABCDE = [int(input()) for _ in range(5)]
    d = [(k, 10 - (k % 10) if k % 10 != 0 else 0,) for k in ABCDE]
    d.sort(key=lambda x:x[1])
    abced = [k[0] for k in d]
    result = 0
    for i in abced[:-1]:
        if i % 10 == 0:
            result += i
        else:
            result += 10 * math.ceil(i / 10)
        print(result)
    result += abced[-1]
    print(result)

if __name__ == "__main__":
    main()