#include <bits/stdc++.h>
using namespace std;
bool Is_Prime(long long n) {
  if (n == 1)
    return false;
  else {
    for (int i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) return false;
    }
  }
  return true;
}
bool Is_Vowel(char c) {
  string s = "aeiouAEIOU";
  for (unsigned int i = 0; i < s.size(); i++) {
    if (s[i] == c) return true;
  }
  return false;
}
long long BinTODes(string s) {
  long long base = 1, Decimal_num = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '1') Decimal_num += base;
    base *= 2;
  }
  return Decimal_num;
}
int GCD(int n, int m) {
  vector<int> vec;
  for (int i = 1; i <= min(n, m); i++) {
    if (m % i == 0 && n % i == 0) vec.push_back(i);
  }
  sort(vec.rbegin(), vec.rend());
  return vec[0];
}
long long Fibonacci(long long n) {
  if (n <= 1) return 1;
  return Fibonacci(n - 1) + Fibonacci(n - 2);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, x, n;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    cout << x * 2 << endl;
  }
  return 0;
}
