Python script to determine optimum payment plan for multiple loans