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

K=int(eval(input()))



if K%2==0:

    print((-1))

    exit(0)

    

ans=[0]*(pow(10,6)+1)

ans[0]=0



for i in range(1,pow(10,6)):

    ans[i]=(ans[i-1]*10+7)%K

    if ans[i]==0:

        print(i)

        exit(0)



print((-1))

# optimized version of the same code:

import functools



K=int(eval(input()))

 

if K%2==0:

    print((-1))

    exit(0)



mod=0



for i in range(1,pow(10,6)):

    mod=(mod*10+7)%K

    if mod==0:

        print(i)

        exit(0)

        

print((-1))
K = int(eval(input()))
if K % 2 == 0:
    print((-1))
    exit(0)
ans = [0] * (pow(10, 6) + 1)
ans[0] = 0
for i in range(1, pow(10, 6)):
    ans[i] = (ans[i - 1] * 10 + 7) % K
    if ans[i] == 0:
        print(i)
        exit(0)
print((-1))

import functools

K = int(eval(input()))
if K % 2 == 0:
    print((-1))
    exit(0)
mod = 0
for i in range(1, pow(10, 6)):
    mod = (mod * 10 + 7) % K
    if mod == 0:
        print(i)
        exit(0)
print((-1))

+import functools + -ans = [0] * (pow(10, 6) + 1) -ans[0] = 0 +mod = 0 -    ans[i] = (ans[i - 1] * 10 + 7) % K -    if ans[i] == 0: +    mod = (mod * 10 + 7) % K +    if mod == 0: