#include <bits/stdc++.h>
using namespace std;
const int BUF = 1000000;
char buf[BUF], *p1, *p2;
inline char getChar() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, BUF, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  register int f = 0;
  char c;
  while (!isdigit(c = getChar())) {
  }
  do f = f * 10 + (c ^ 48);
  while (isdigit(c = getChar()));
  return f;
}
const int maxN = 100003;
int main() {
  int T, n, x;
  for (T = read(); T; --T) {
    n = read(), x = read();
    printf("%d\n", x << 1);
  }
  return 0;
}
