#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int L, R;
    cin >> L >> R;
    if (R % L == 0)
      cout << L << " " << R << endl;
    else {
      if (R % 2 == 0) {
        cout << R / 2 << " " << R << endl;
      } else {
        R--;
        cout << R / 2 << " " << R << endl;
      }
    }
  }
  return 0;
}
