#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const long long INF = 1e18;
long long n, l, r, j, i, w;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> l >> r;
    w = l;
    cout << w << " ";
    if (w * 2 <= r and w != 1)
      cout << w * 2 << endl;
    else {
      for (j = l + 1; j <= r; j++) {
        if (j % w == 0) {
          cout << j << endl;
          break;
        }
        j += w;
      }
    }
  }
  return 0;
}
