#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int v = 0, c = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') c = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    v = v * 10 + ch - 48;
    ch = getchar();
  }
  return v * c;
}
int main() {
  int T = read();
  while (T--) {
    int n = read(), x = read();
    printf("%d\n", x * 2);
  }
  return 0;
}
