Output is correct but no test cases satisfied

i have followed the left right approach as mentioned in hint video.

@Yuganshu,

https://ide.codingblocks.com/s/254449 corrected code.
there should be a space after you print the first number.

For the sample test case:
Your output:

1,2 and 7
1,3 and 6
1,4 and 5
2,3 and 5

Expected output:

1, 2 and 7
1, 3 and 6
1, 4 and 5
2, 3 and 5