#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int l, r;
    int count = 0;
    cin >> l >> r;
    if (l == 1) {
      cout << l << " " << r << "\n";
      continue;
    } else {
      for (int i = l; i <= r; i++) {
        if (i * 2 <= r) {
          cout << i << " " << i * 2 << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
