#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int x, y;
    cin >> x >> y;
    cout << 2 * y << endl;
  }
  return 0;
}
