#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c;
  cin >> a;
  while (a--) {
    cin >> b >> c;
    if (c % b == 0) {
      cout << b << " " << c << endl;
    } else {
      cout << b << " " << c - (c % b) << endl;
    }
  }
}
