
# 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:

n = int(eval(input())) % 1000

if n == 0:

    print((0))

else:

    print((1000 - n))

# optimized version of the same code:

n = int(eval(input()))

print(((1000 - n % 1000) % 1000))
n = int(eval(input())) % 1000
if n == 0:
    print((0))
else:
    print((1000 - n))

n = int(eval(input()))
print(((1000 - n % 1000) % 1000))

-n = int(eval(input())) % 1000 -if n == 0: -    print((0)) -else: -    print((1000 - n)) +n = int(eval(input())) +print(((1000 - n % 1000) % 1000))