#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const double EPS = 1e-10;
const double PI = acos(-1);
class ARemoveAProgression {
 public:
  int T;
  void input(std::istream& in, std::ostream& out) {
    ios_base::sync_with_stdio(false);
    in.tie(nullptr), out.tie(nullptr);
    in >> T;
  }
  void solve(std::istream& in, std::ostream& out) {
    input(in, out);
    while (T--) {
      int x, n;
      in >> n >> x;
      out << 2 * x << '\n';
    }
  }
};
int main() {
  ARemoveAProgression solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
