#include <bits/stdc++.h>
using namespace std;
long long po(long long a, long long b, long long M) {
  long long res = 1;
  a = a % M;
  while (b) {
    if (b % 2) res = (res * a) % M;
    b /= 2;
    a = (a * a) % M;
  }
  return res;
}
long long pw(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return po(x, y / 2, 1000000007) % 1000000007 * po(x, y / 2, 1000000007) %
           1000000007;
  else
    return x * po(x, y / 2, 1000000007) % 1000000007 *
           po(x, y / 2, 1000000007) % 1000000007;
}
long long modInverse(long long n, long long M) { return po(n, M - 2, M); }
long long nCrModPFermat(long long n, long long r, long long M) {
  if (!r) return 1;
  long long fac[n + 1];
  fac[0] = 1;
  long long i;
  for (i = 1; i < n + 1; i++) {
    fac[i] = fac[i - 1] * i % M;
  }
  return (fac[n] * modInverse(fac[r], M) % M * modInverse(fac[n - r], M) % M) %
         M;
}
long long logk(long long a, long long b) { return log(a) / log(b); }
bool isPrime(long long N) {
  for (long long i = 2; i * i <= N; ++i) {
    if (N % i == 0) return false;
  }
  return true;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool comp(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first == b.first)
    return a.first < b.first;
  else
    return a.second < b.second;
}
bool sortin(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second)
    return a.second < b.second;
  else
    return a.first < b.first;
}
vector<bool> prime(400005, true);
void SieveOfEratosthenes(long long n) {
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n, x;
    cin >> n >> x;
    cout << x * 2 << "\n";
  }
  return 0;
}
