The secrets of living a long life

Is it good genes or good habits that lead to a long life?