s, e, N = input().split() N = int(N) if s != e and N > 1: print(s + 'x'*(N-2) + e) elif s == e and N == 1: print(s) else: print(-1)