#include <bits/stdc++.h>
using namespace std;
int s[200001];
long long n, r;
int main() {
  cin >> n;
  cin >> r;
  for (int i = 0; i < n; i++) {
    scanf("%d", &s[i]);
  }
  sort(s, s + n);
  for (long long i = 0, j; i < n; i = j) {
    j = i + 1;
    while (j < n && s[j] == s[j - 1]) j++;
    if (r - (j - i) * n <= 0) {
      cout << s[i] << " " << s[(r - 1) / (j - i)] << endl;
      return 0;
    } else {
      r -= (j - i) * n;
    }
  }
}
