#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
int main()
{
int t;
cin>>t;
while(t--)
{
int o;
cin>>o;
int x,p;
cin>>x>>p;
if(o==1){
cout<<(x<<p)<<endl;
}
else cout<<(x>>p)<<endl;
}
return 0;
}

京公网安备 11010502036488号