#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  cin >> n;
  long a[n], b[n];
  for (long i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (long i = 0; i < n; i++) {
    if (b[i] % a[i] == 0) {
      cout << a[i] << " " << b[i] << endl;
    } else {
      cout << a[i] << " " << a[i] * 2 << endl;
    }
  }
  return 0;
}
