#include <bits/stdc++.h>
using namespace std;
int arr[1000000];
int main() {
  long long t, a, b, n;
  cin >> t;
  while (t > 0) {
    cin >> a >> b;
    cout << 2 * b << endl;
    t--;
  }
  return 0;
}
