Your program seems 'almost correct'.
That is, your program did not crash with any test case,
it was fast enough compared to the Jutge's solution,
and its output for every case always (nearly) matched
the output of the Jutge's solution.
Except for some small mismatches,
your program would get an AC.
Check for additional or missing empty lines,
additional or missing spaces,
tabs (none of our problem's output has tabs),
and distractions related to lowercase and uppercase letters.