#include using namespace std; long long c, v, s, grup, i; int main () { cin>>c>>v; if (c == 1) { /// aflam valoarea de pe pozitia v s = 0; for (grup = 1;;grup++) { s += grup + (grup+1)/2; if (s >= v) break; } s -= (grup + (grup+1)/2); v -= s; /// ne intereseaza valoarea de pe pozitia v din grupul /// grup if (v <= grup) { cout<