#include <bits/stdc++.h>
using namespace std;
const int AKA = 1e6 + 6;
int arr[AKA];
int arr1[AKA];
int SD() {
  int i;
  scanf("%d", &i);
  return i;
}
long long SLL() {
  long long i;
  scanf("%lld", &i);
  return i;
}
void watchset_e(set<int> SET, int N) {
  set<int>::iterator ITERATOR = SET.begin();
  advance(ITERATOR, N);
  printf("Element in %dth = %d \n", N, *ITERATOR);
}
set<int>::iterator it;
int main() {
  int n = SD();
  for (int i = 0; i < n; i++) {
    int a = SD(), b = SD();
    long long b1 = 2 * b;
    cout << b1 << endl;
  }
  return 0;
}
