#include <bits/stdc++.h>
using namespace std;
int q[10000001];
vector<int> v;
int main() {
  long long n, a, b, i, cnt = 0, c = 0;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    cout << b * 2 << "\n";
  }
}
