a = [] for i in range(3): a.append(int(input())) coins = sum(a) while (True): if (a[2] >= 25): a[2] -= 25 a[1] += 1 continue break while(True): if(a[1] >= 4): a[1] -= 4 a[0] += 1 continue break while(True): if(a[0] >= 10): a[0] -= 10 continue break coinsA = sum(a) print(coins, coinsA)