#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > ans;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int x, y;
    cin >> x >> y;
    for (int i = x; i <= y; i++) {
      if (i + i <= y) {
        ans.push_back({i, i + i});
        break;
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second << endl;
  }
  return 0;
}
