here is my code :
https://paste.ubuntu.com/p/Xc4NfRjRyh/
tried almost all the testcases from comments.
tried these too :
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777
9876543210987654321098765432109876543210987654321098765432109876543210987654321098765432109876543210
109876543210987654321098765432109876543210987654321098765432109876543210987654321098765432109876548
and my output was :
8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
4993209877099320987709932098770993209877099320987709932098770993209877099320987709932098770993209879
4883333333888333333388833333338883333333888333333388833333338883333333888333333388833333338883333331
cant figure out whats going wrong , someone please help!