#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  while (n-- > 0) {
    unsigned int a, b;
    cin >> a >> b;
    cout << 2 * b << '\n';
  }
  return 0;
}
