Greece on knife edge in last hours to agree bailout