#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
const double PI = 3.14159;
vector<long long> v;
long long n, m, k, t, ans, sum, r, l, b, c, d, even, odd;
char z;
bool flag;
string s, a;
map<string, int> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> l >> r;
    for (int i = l + l; i <= r; i += l) {
      if (i <= r) {
        cout << l << " " << i << endl;
        break;
      }
    }
  }
  return 0;
}
