def somme(notes):
  return notes['NSI'] + notes['maths'] + notes['physique']

def plusPetit(n1, n2):
  if n1['NSI'] < n2['NSI']:
    return True
  if n1['NSI'] == n2['NSI']:
    if somme(n1) < somme(n2):
      return True
    elif somme(n1) == somme(n2) and n1['nom'] < n2['nom']:
      return True
  return False