#include <bits/stdc++.h>
using namespace std;
int bull[100010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &bull[i]);
  }
  int k;
  scanf("%d", &k);
  sort(bull, bull + n);
  for (int i = 0; i < n; i++) {
    int temp = k - bull[i];
    for (int j = i + 1; j < n; j++) {
      if (bull[j] == temp) {
        printf("%d %d\n", bull[i], bull[j]);
        return 0;
      }
    }
  }
  printf("No\n");
  return 0;
}
