#include <bits/stdc++.h>
const int N = 30010;
const long long mod = 998244353;
using namespace std;
int n;
int a[N], a1[N], a2[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    cout << y * 2 << endl;
  }
}
