s,e,n = input().split() n = int(n) if n == 1: if s != e: print(-1) else: print(s) else: ans = s*(n-1) + e print(ans)