#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int l, r;
  for (int i = 1; i <= a; i++) {
    cin >> l >> r;
    int b;
    int c;
    for (int j = l; j <= r; j++) {
      if (r % 2 == 0) {
        b = r / 2;
        c = r;
      } else {
        b = (r - 1) / 2;
        c = r - 1;
      }
    }
    cout << b << " " << c << endl;
  }
  return 0;
}
