read c:string(1) gets translated to char c[2]; fgets(c, 2, stdin);
But it should be char c[3]; fgets(c, 3, stdin); as you read the actual text, the linebreak and the \0 to terminate the string.
You can verify it like this: for (int i = 0; i < 3; i++) printf("%d ", c[i]); // print 100 10 0 (with 100='d')
I remember @Niako reporting that about a year ago. It also caused some hiccups in the last contest, see stub.txt.
edit: Link to Niako’s post