#include <cstdio> #include <algorithm> using namespace std; int main() { int n1, n2; int arr1[1005]; while(EOF != scanf("%d", &n1)) { for(int i=0; i<n1; i++) { scanf("%d", arr1 + i); } scanf("%d", &n2); for(int i=n1; i<n1+n2; i++) { scanf("%d", arr1 + i); } sort(arr1, arr1+n1+n2); printf("%d", arr1[0]); for(int i=1; i<n1+n2; i++) { if(arr1[i] != arr1[i-1]) { printf("%d", arr1[i]); } } printf("\n"); } return 0; }