UK PM says at G7 summit that end to war will need to recognise country's territorial integrity