maths_mark = int(input("Enter maths mark: "))
chem_mark = int(input("Enter chemistry mark: "))
physics_mark = int(input("Enter physics mark: "))

total_marks = maths_mark + chem_mark + physics_mark

if total_marks < 40:
    print("You failed")
elif:
    total_marks >= 40:
    print("D")
elif:
    total_marks >= 50:
    print("C")
elif:
    total_marks >= 60:
    print("B")
elif total_marks >= 70:
    print("A")