@@ -0,0 +1,793 @@
+lst = %5Bi for i in input().split()%5D%0A%0As = str(lst%5B0%5D)%0An = int(lst%5B1%5D)%0A%0Ai = 1%0Aif len(s) == 1:%0A    s = %221%22+ s%0A    i += 1%0Awhile len(s) %3C= 2:   %0A    if s%5B0%5D != s%5B1%5D:%0A        s = %221%22 + s%5B0%5D + %221%22 + s%5B1%5D%0A    else:%0A        s = %222%22 + s%5B0%5D%0A    i += 1%0A        %0A%0Awhile i %3C n:%0A    new = %22%22%0A    length_s = len(s)%0A    count = 1%0A    for j in range(1, length_s):%0A        if j == length_s - 1:%0A            if s%5Bj-1%5D != s%5Bj%5D:%0A                new += str(count) + s%5Bj-1%5D%0A                count = 1%0A                new += %221%22 + s%5Bj%5D%0A                %0A            else:%0A                count += 1%0A                new += str(count) + s%5Bj%5D%0A                %0A        elif s%5Bj-1%5D != s%5Bj%5D:%0A            new += str(count) + s%5Bj-1%5D%0A            count = 1%0A        else:%0A            count += 1%0A    s = new%0A    i += 1%0A    %0Aprint(s)%0A

Create P2.py