#include <stdio.h>
#include <stdlib.h>
 
int main() {
  int i=0, j=0, k=0, l=0;
  int arr[10000];
  int brr[10000];
  char temp, temp2;
  do {
      scanf("%d%c", &arr[i], &temp);
      i++;
  } while(temp != '\n');
  
  do {
      scanf("%d%c", &brr[j], &temp2);
      j++;
  } while(temp2 != '\n');
  
  for(k=0; k<i; k++) {
    printf("%d ", arr[k]);
  }
  
  for(l=0; l<j; l++) {
    printf("%d ", brr[l]);
  }
 
  return 0;
}