#include <bits/stdc++.h>
using namespace std;
int t;
long long l[1600], r[1600], x, y;
int main() {
  cin >> t;
  for (int i = 1; i <= t; i++) {
    cin >> l[i] >> r[i];
  }
  for (int i = 1; i <= t; i++) {
    if (r[i] % l[i] == 0) {
      cout << l[i] << " " << r[i] << endl;
      continue;
    } else {
      y = l[i] * 2;
      cout << l[i] << " " << y << endl;
    }
  }
  return 0;
}
