#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, r;
  cin >> n;
  vector<pair<int, int> > arr;
  for (int i = 0; i < n; i++) {
    cin >> l >> r;
    arr.push_back(make_pair(l, r));
  }
  for (int i = 0; i < n; i++) {
    if (arr[i].second & 1) arr[i].second--;
    cout << int(arr[i].second / 2) << ' ' << arr[i].second << endl;
  }
  return 0;
}
