What 's wrong in my code?

INSPITE OF GETTING RIGHT ANSWER FOR GIVEN TEST CASES MY SUBMITTED ANS IS BEING SHOWN WRONG ,WHAT’S WRONG IN MY CODE OR THE TEST CASES I AM LEAVING

QUESTION LINK:CodeChef: Practical coding for everyone

MY CODE LINK:#include<stdio.h>#include<string.h>#include<math.h>#include<stdlib.h>cha - Pastebin.com

There is some problem with output format in your code like printf("\nmany") should be replaced by printf(“many\n”) and do not print any extra line like line no 41. Also, there is some problem with logic
Consider this test case
monday tuesday 9 9
output = impossible
answer = 9