#include char a, b; int c; int main() { scanf("%c %c %d", &a, &b, &c); if(a!=b&&c==1) puts("-1"); else { for(int i=1; i