#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
  long long res = 1;
  x = x % 1000000007;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % 1000000007;
    }
    y = y >> 1;
    x = (x * x) % 1000000007;
  }
  return res;
}
long long inv(long long x) { return power(x, 1000000007 - 2); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t, n, x, i;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    cout << 2 * x << endl;
  }
}
