#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
bool check(pair<long long int, long long int> p1,
           pair<long long int, long long int> p2) {
  return p2.second > p1.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  while (n--) {
    long long int l, r;
    cin >> l >> r;
    if (l == 1) {
      cout << l << " " << r;
    } else {
      cout << l << " " << 2 * l;
    }
    cout << endl;
  }
  return 0;
}
