Cummins keeps Australia alive after India set them 399 target