#include<stdio.h>
#include<ctype.h>
int main(){
    char s1[105], s2[105];
    int i, valid = 1;
    if(fgets(s1, sizeof(s1), stdin)== NULL)return 0;
    if(fgets(s2, sizeof(s2), stdin)== NULL)return 0;
   s1[strcspn(s1," ")] = '';
   s2[strcspn(s2," ")] = '';
for (i = 0; s1[i] != ''; i++){
    if(!isalpha((unsigned char)s1[i])){
        valid = 0;
        break;
    }
}
if(valid){
    for (i = 0; s2[i] != ''; i++)
    {
        if (!isalph((unsigned char)s2[i])){
            valid = 0
            break;
        }
    }
}
if (!valid){
    printf("Ivalid input");
}else{
    printf("%s%s", s1, s2);
}
return 0;
}