#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    if (b % a == 0)
      cout << a << " " << b << endl;
    else {
      if (b % 2 != 0)
        cout << b / 2 << " " << b - 1 << endl;
      else
        cout << b / 2 << " " << b << endl;
    }
  }
  return 0;
}
