#include <bits/stdc++.h>
using namespace std;
int T;
int main() {
  scanf("%d", &T);
  for (int t = 1; t <= T; ++t) {
    int l, r;
    scanf("%d %d", &l, &r);
    printf("%d %d\n", l, l * (r / l));
  }
  return 0;
}
