#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " ";
  err(++it, args...);
}
const int M = 1e9 + 7;
int length(string s) { return (int)s.size(); }
int length(long long x) {
  int l = 0;
  for (long long i = x; i; i /= 10) l++;
  return l;
}
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
long long power(long long a, long long n) {
  long long int res = 1;
  while (n) {
    if (n & 1) res = ((res % M) * (a % M)) % M;
    a = ((a % M) * (a % M)) % M;
    n >>= 1;
  }
  return res % M;
}
int tc = 1;
inline void read(std::vector<int>& v) {
  for (int i = 0; i < (int)v.size(); i++) {
    cin >> (v[i]);
  }
}
inline void readl(std::vector<long long int>& v) {
  for (int i = 0; i < (int)v.size(); i++) {
    cin >> (v[i]);
  }
}
template <class T>
bool remin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool remax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
inline void read(int v[], int n) {
  for (int i = 0; i < n; i++) {
    cin >> (v[i]);
  }
}
inline void readl(long long int v[], int n) {
  for (int i = 0; i < n; i++) {
    cin >> (v[i]);
  }
}
inline int add(int a, int b, int mod) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int sub(int a, int b, int mod) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline int mul(int a, int b, int mod) { return (long long int)a * b % mod; }
const int Inf = (int)2e9 + 5;
const long long int Lnf = (long long int)2e18 + 5;
const int N = 5e5 + 5;
const int NN = 1e6 + 5;
int solve() {
  long long int n, k;
  cin >> n >> k;
  cout << 2 * k << endl;
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int test = 1;
  cin >> test;
  while (test--) solve();
  return 0;
}
