#include <bits/stdc++.h>
using namespace std;
vector<int> vi;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t, c = 0, i, j, p, x, y, osum, nsum = 0, m, v;
  int n;
  cin >> t;
  while (t--) {
    cin >> x >> y;
    cout << y * 2 << endl;
  }
  return 0;
}
