#include <bits/stdc++.h>
const int INF = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vii = vector<pii>;
using vi = vector<ll>;
int D(int px, int py, int qx, int qy, int rx, int ry) {
  return (px * qy + qx * ry + rx * py) - (py * qx + qy * rx + ry * px);
}
int main() {
  int n, T, first;
  cin >> T;
  while (T--) {
    cin >> n >> first;
    cout << 2 * first << endl;
  }
  return 0;
}
