#include <bits/stdc++.h>
int main() {
  int t, m;
  scanf("%d", &t);
  m = t - 1;
  long long arr[t][2];
  while (t--) {
    long long l, r, x, y;
    int f = 0;
    scanf("%lld%lld", &l, &r);
    y = r;
    while (f != 1 && y >= r / 2) {
      if (y % 2 != 0) y -= 1;
      if (y / 2 >= l) {
        x = y / 2;
        break;
      } else
        y--;
    }
    arr[t][0] = x;
    arr[t][1] = y;
  }
  for (int i = m; i >= 0; i--) printf("%lld %lld\n", arr[i][0], arr[i][1]);
  return 0;
}
