
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')


# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)



# slower version:

while True:

    try:

        for i in range(3):

            line = input().strip()

            if line == '0':

                raise Exception



            a = b = 0

            for i, s in enumerate(line):

                if i != 0:

                    if s == 'A':

                        a += 1

                    else:

                        b += 1

            if a > b:

                a += 1

            else:

                b += 1

            print(a, b)



    except:

        break

# optimized version of the same code:

while True:

    try:

        for i in range(3):

            line = input().strip()

            if line == '0':

                raise Exception



            if line[0] == 'A':

                a = -1

                b = 0

            else:

                a = 0

                b = -1

            for i, s in enumerate(line):

                if s == 'A':

                    a += 1

                else:

                    b += 1

            if a > b:

                a += 1

            else:

                b += 1

            print(a, b)



    except:

        break
while True:
    try:
        for i in range(3):
            line = input().strip()
            if line == "0":
                raise Exception
            a = b = 0
            for i, s in enumerate(line):
                if i != 0:
                    if s == "A":
                        a += 1
                    else:
                        b += 1
            if a > b:
                a += 1
            else:
                b += 1
            print(a, b)
    except:
        break

while True:
    try:
        for i in range(3):
            line = input().strip()
            if line == "0":
                raise Exception
            if line[0] == "A":
                a = -1
                b = 0
            else:
                a = 0
                b = -1
            for i, s in enumerate(line):
                if s == "A":
                    a += 1
                else:
                    b += 1
            if a > b:
                a += 1
            else:
                b += 1
            print(a, b)
    except:
        break

-            a = b = 0 +            if line[0] == "A": +                a = -1 +                b = 0 +            else: +                a = 0 +                b = -1 -                if i != 0: -                    if s == "A": -                        a += 1 -                    else: -                        b += 1 +                if s == "A": +                    a += 1 +                else: +                    b += 1