func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 100005;   char s[N];   int n, a[N], pre[N][26], suf[N][26];   int f[N][26], g[N], mem[27];   inline int mex(int st) { return __builtin_ctz(~st); }   int calc(int l, int r, int c, int fl) {     if (l > r) return 0;     if (~mem[c]) return mem[c];     int st = 0;     for (int j = 0; j < 26; j++) {       int ll = suf[l][j], rr = pre[r][j];       if (rr >= l)         st |= 1 << (g[rr] ^ g[ll] ^ (!fl ? f[ll - 1][c] : calc(l, ll - 1, j, 1)) ^                     (fl ? f[r][j] : calc(rr + 1, r, j, 0)));     }     return mem[c] = mex(st);   }   int main() {     ios::sync_with_stdio(false);     cin >> (s + 1);     n = strlen(s + 1);     for (int i = 1; i <= n; i++) a[i] = s[i] -  a ;     for (int i = 1; i <= n; i++) {       for (int j = 0; j < 26; j++) pre[i][j] = pre[i - 1][j];       pre[i][a[i]] = i;     }     for (int j = 0; j < 26; j++) suf[n + 1][j] = n + 1;     for (int i = n; i > 0; --i) {       for (int j = 0; j < 26; j++) suf[i][j] = suf[i + 1][j];       suf[i][a[i]] = i;     }     for (int i = 1; i <= n; i++) {       g[i] = f[i - 1][a[i]] ^ g[pre[i - 1][a[i]]];       memset(mem, -1, sizeof(mem));       for (int j = 0; j < 26; j++) f[i][j] = calc(pre[i][j] + 1, i, j, 0);     }     int q;     cin >> q;     while (q--) {       int l, r;       cin >> l >> r;       memset(mem, -1, sizeof(mem));       if (calc(l, r, 26, 1))         puts( Alice );       else         puts( Bob );     }     return 0;   }   