#include <bits/stdc++.h>
using namespace std;
int n;
void xuly(long long l, long long r) {
  for (long long i = l; i <= r; i++) {
    for (long long k = 2; i * k <= r; k++) {
      cout << i << " " << l * k << "\n";
      return;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long l, r;
    scanf("%lld%lld", &l, &r);
    xuly(l, r);
  }
  return 0;
}
