#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x = 0, y = 0;
  long long int n, k;
  int a[100100];
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long int c, d;
  c = k / n;
  if (k % n == 0) c--;
  int num = 0;
  for (int i = 0; i < n; i++) {
    if (a[c] == a[i]) {
      num++;
      if (x)
        y = i + 1;
      else
        x = i + 1;
    }
  }
  if (num == 1) {
    d = k % n;
    if (d == 0)
      d = n - 1;
    else
      d--;
    cout << a[c] << " " << a[d];
  } else {
    int m = x;
    x = (x - 1) * n + 1;
    k = k - x + 1;
    d = k / num;
    if (k % num == 0) d--;
    cout << a[c] << " " << a[d];
  }
}
