#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, x, y;
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> x >> y;
    if (x == 1) {
      cout << x << " " << y << endl;
      continue;
    }
    for (long j = x; j < y; j++) {
      if (j * 2 <= y) {
        cout << j << " " << j * 2 << endl;
        break;
      }
    }
  }
}
