#include <bits/stdc++.h>
using namespace std;
int a[100001];
int main() {
  int N;
  scanf("%d", &N);
  int a[N];
  for (int i = 0; i < N; i++) scanf("%d", &a[i]);
  int K;
  scanf("%d", &K);
  sort(a, a + N);
  int i;
  for (i = 0; i < N; i++) {
    if (binary_search(a + i + 1, a + N, K - a[i])) {
      printf("%d %d\n", a[i], K - a[i]);
      break;
    }
  }
  if (i == N - 1) printf("No\n");
  return 0;
}
