#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  int *a = (int *)malloc(n * sizeof(int));
  int *b = (int *)malloc(n * sizeof(int));
  int s = 0;
  int f = 0;
  int c = 0;
  for (int i = 0; i < n; i++) {
    c = 0;
    scanf("%d%d", &s, &f);
    for (int j = s; j < f; j++) {
      for (int k = 2 * j; k <= f; k++) {
        if (k % j == 0) {
          a[i] = j;
          b[i] = k;
          c = 1;
          break;
        }
      }
      if (c == 1) break;
    }
  }
  for (int i = 0; i < n; i++) printf("%d %d\n", a[i], b[i]);
  return 0;
}
