#!/usr/bin/env python3
#encoding: windows-1252

# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

import sys

if __name__ == "__main__":
    while True:
        linha = input()

        if linha in '0':
            break

        temp = linha.split(" ")

        d1 = int(temp[0])
        d2 = int(temp[1])
        d3 = int(temp[2])
        a11 = int(temp[3])
        a12 = int(temp[4])
        a21 = int(temp[5])
        a22 = int(temp[6])
        a23 = int(temp[7])

        media = d1 + d2 + d3 + int((a11+a12)/2) + int((a21+a22+a23)/3)

        if media < 60:
            print("Aluno reprovado com nota: "+str(media))
        else:
            print("Aluno aprovado com nota: "+str(media))
            
sys.exit(0)