#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int* results = new int[N];
  for (int i = 0; i < N; i++) {
    int num, pos;
    cin >> num >> pos;
    results[i] = pos * 2;
  }
  for (int i = 0; i < N; i++) cout << results[i] << endl;
  return 0;
}
