#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    while (l <= r) {
      int x = l;
      if (2 * x <= r) {
        cout << x << " " << 2 * x << endl;
        break;
      } else {
        continue;
      }
      l++;
    }
  }
  return 0;
}
