#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int **result = (int **)malloc(sizeof(int *) * n);
  for (int i = 0; i < n; i++) {
    result[i] = (int *)malloc(sizeof(int) * 2);
    int l, r;
    cin >> l;
    cin >> r;
    if ((l * 2) <= r) {
      result[i][0] = l;
      result[i][1] = l * 2;
    }
  }
  for (int m = 0; m < n; m++)
    cout << result[m][0] << " " << result[m][1] << endl;
  return 0;
}
