#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
vector<long long> flash(long long n) {
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  return a;
}
void Shazam() {
  long long a, b;
  cin >> a >> b;
  cout << 2 * b << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    Shazam();
  }
  return 0;
}
