#include<cstdio>
#include<cmath>

long long x, ans;
int n, m;

long long bit_xx(long long a){
    if(a == 0) return 0;
    int k = log2(a);
    if(k > 1){
        long long tot = (1 - a % 2) * 1ll << k;
        tot ^= bit_xx(a - 1ll << k);
        return tot;
    }
    if(a==1) return 1;
    if(a==2) return 3;
    return 0;
}

int main(){
    freopen("c.in", "r", stdin);
    scanf("%d", &n);
    for(int i = 0; i < n; i ++){
        scanf("%I64d %I64d", &x, &m);
        ans ^= bit_xx( x + m - 1);
        ans ^= bit_xx( x - 1);
    }
    if(ans) puts("tolik");
    else puts("bolik");

}


#include<stdio.h>
#include<math.h>

long long x, ans;
int n, m;

long long bit_xx(long long a){
    if(a == 0) return 0;
    if(a==1) return 1;
    if(a==2) return 3;
    if(a==3) return 0;
    int k = 63 - __builtin_clzll(a);
    long long tot = (1 - a % 2) * (1ll << k);
    tot ^= bit_xx(a - (1ll << k));
    return tot;
}

int main(){
    //freopen("c.in", "r", stdin);
    scanf("%d", &n);
    for(int i = 0; i < n; i ++){
        cin>>x>>m;
        ans ^= bit_xx( x + m - 1);
        ans ^= bit_xx( x - 1);
    }
    if(ans > 0) puts("tolik");
    else puts("bolik");
}


///	Choe Kwang C

#include <bits/stdc++.h>
using namespace std;
#define N 100100
typedef long long LL;

#define N 100100
#define M 61

int n, bit[M];
LL x[N], m[N], ex[M];

LL calc(LL n, LL m) {
	int en = 1;
	for (int i = 0; i < M; i ++) {
		if (ex[i] > n + m) {en = i; break;}
	}
	int r = m % 4, st = n % 2;
	bit[0] = 0;
	for (int i = 0; i < r; i ++) bit[0] += st + i;
	bit[0] &= 1;
	for (int i = 1; i <= en; i ++) {
		LL r = m % ex[i+1], st = n % ex[i+1];
		if (st >= ex[i]) {
			if (st + r - 1 < ex[i+1]) bit[i] = r & 1;
			else if (ex[i+1] - st + ex[i] <= r) bit[i] = (ex[i+1] - st) & 1;
			else bit[i] = (r - ex[i]) & 1;
		}
		else {
			if (st + r - 1 < ex[i]) bit[i] = 0;
			else bit[i] = min((r - (ex[i] - st)), ex[i]) & 1;
		}
	}
	LL rlt = 0;
	for (int i = 0; i <= en; i ++) if (bit[i]) rlt += 1ll << i;
	return rlt;
}

int main() {
//	freopen("c.in", "r", stdin);
	ex[0] = 1;
	for (int i = 1; i < M; i ++) ex[i] = ex[i-1] << 1;
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++) scanf("%I64d %I64d", &x[i], &m[i]);
	LL ans = 0;
	for (int i = 1; i <= n; i ++) {
		ans ^= calc(x[i], m[i]);
	}
	if (ans) puts("tolik");
	else puts("bolik");
	return 0;
}


#include<stdio.h>
#include<math.h>

long long x, ans;
int n, m;

long long bit_xx(long long a){
    if(a == 0) return 0;
    if(a==1) return 1;
    if(a==2) return 3;
    if(a==3) return 0;
    int k = 63 - __builtin_clzll(a);
    long long tot = (1 - a % 2) * (1ll << k);
    tot ^= bit_xx(a - (1ll << k));
    return tot;
}

int main(){
    //freopen("c.in", "r", stdin);
    scanf("%d", &n);
    for(int i = 0; i < n; i ++){
        scanf("%I64d %I64d", &x, &m);
        ans ^= bit_xx( x + m - 1);
        ans ^= bit_xx( x - 1);
    }
    if(ans > 0) puts("tolik");
    else puts("bolik");
}


#include<stdio.h>
typedef __int64 ll;
int main(){
    ll n, ans;
    ll x, a;
    while(scanf("%I64d", &n) == 1){
        ll ans = 0;
        for(ll i = 0; i < n; i ++) {
            scanf("%I64d%I64d", &x, &a);
            for(ll j = 0; j < x; j ++) {
                ans = ans ^ a + j;
            }
        }
        if(ans )puts("tolik") ;
        else puts("bolik");
    }
}


#include<cstdio>
#include<cmath>

long long x, ans;
int n, m;

long long bit_xx(long long a){
    if(a == 0) return 0;
    int k = log2(a);
    if(k > 1){
        long long tot = (1 - a % 2) * (1ll << k);
        tot ^= bit_xx(a - (1ll << k));
        return tot;
    }
    if(a==1) return 1;
    if(a==2) return 3;
    return 0;
}

int main(){
    //freopen("c.in", "r", stdin);
    scanf("%d", &n);
    for(int i = 0; i < n; i ++){
        scanf("%I64d %I64d", &x, &m);
        ans ^= bit_xx( x + m - 1);
        ans ^= bit_xx( x - 1);
    }
    if(ans) puts("tolik");
    else puts("bolik");
}


//C
#include <stdio.h>
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

typedef long long ll;

int n;
ll pow[66];

void init(){
    pow[0] = 1;
    for(int i = 1; i < 60; i ++) pow[i] = pow[i - 1] * 2;
}

ll f(ll x, ll m){
    ll ans = 0;
    for(int i = 0; i < 60; i ++){
        ll cnt = 0;

        ll st = (x - 1) / pow[i] + 1;
        ll ST = st * pow[i];

        if(ST >= x + m) {
            if(st % 2 == 0) cnt += m;
        }
        else {
            ll en = (x + m - 1) / pow[i];
            ll EN = en * pow[i];

            if(st % 2 == 0) cnt += (ST - x);
            if(en & 1) cnt += (x + m - en);
            st = st / 2 * 2 + 1;
            en = en / 2 * 2;
            cnt += max(0, en - st + 1) / 2 * pow[i];
        }

        if(cnt & 1) ans += pow[i];
    }
    return ans;
}

int main(){
    //freopen("c.in", "r", stdin);
    init();

    scanf("%d", &n);
    ll ans = 0;
    for(int i = 0; i < n; i ++){
        ll x, m;
        scanf("%I64d %I64d", &x, &m);
        ans = ans ^ f(x, m);
    }

    if(ans) puts("tolik");
    else puts("bolik");
}


//C
#include <stdio.h>
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

typedef long long ll;

int n;
ll pow[66];

void init(){
    pow[0] = 1;
    for(int i = 1; i < 60; i ++) pow[i] = pow[i - 1] * 2;
}

ll f(ll x, ll m){
    ll ans = 0;
    for(int i = 0; i < 60; i ++){
        ll cnt = 0;

        ll st = (x - 1) / pow[i] + 1;
        ll ST = st * pow[i];

        if(ST >= x + m) {
            if(st % 2 == 0) cnt += m;
        }
        else {
            ll en = (x + m - 1) / pow[i];
            ll EN = en * pow[i];

            if(st % 2 == 0) cnt += (ST - x);
            if(en & 1) cnt += (x + m - EN);

            st = st / 2 * 2 + 1;
            en = en / 2 * 2;
            cnt += max(0, en - st + 1) / 2 * pow[i];
        }

        if(cnt & 1) ans += pow[i];
    }
    return ans;
}

int main(){
    //freopen("c.in", "r", stdin);
    init();

    scanf("%d", &n);
    ll ans = 0;
    for(int i = 0; i < n; i ++){
        ll x, m;
        scanf("%I64d %I64d", &x, &m);
        ans = ans ^ f(x, m);
    }

    if(ans) puts("tolik");
    else puts("bolik");
}


///	Choe Kwang C

#include <bits/stdc++.h>
using namespace std;
#define N 100100
typedef long long LL;

#define N 100100
#define M 61

int n, bit[M];
LL x[N], m[N], ex[M];

LL calc(LL n, LL m) {
	int en = 1;
	for (int i = 0; i < M; i ++) {
		if (ex[i] > n + m) {en = i; break;}
	}
	int r = m % 4, st = n % 2;
	bit[0] = 0;
	for (int i = 0; i < r; i ++) bit[0] += st + i;
	bit[0] &= 1;
	for (int i = 1; i <= en; i ++) {
		LL r = m % ex[i+1], st = n % ex[i+1];
		if (st >= ex[i]) {
			if (st + r - 1 < ex[i+1]) bit[i] = r & 1;
			else if (ex[i+1] - st + ex[i] >= r) bit[i] = (ex[i+1] - st) & 1;
			else bit[i] = (r - ex[i]) & 1;
		}
		else {
			if (st + r - 1 < ex[i]) bit[i] = 0;
			else bit[i] = min((r - (ex[i] - st)), ex[i]) & 1;
		}
	}
	LL rlt = 0;
	for (int i = 0; i <= en; i ++) if (bit[i]) rlt += 1ll << i;
	return rlt;
}

int main() {
//	freopen("c.in", "r", stdin);
	ex[0] = 1;
	for (int i = 1; i < M; i ++) ex[i] = ex[i-1] << 1;
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++) scanf("%I64d %I64d", &x[i], &m[i]);
	LL ans = 0;
	for (int i = 1; i <= n; i ++) {
		ans ^= calc(x[i], m[i]);
	}
	if (ans) puts("tolik");
	else puts("bolik");
	return 0;
}


#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;

long long x, ans;
int n, m;

long long bit_xx(long long a){
    if(a == 0) return 0;
    int k = log2(a);
    if(k > 1){
        long long tot = (1 - a % 2) * (1ll << k);
        tot ^= bit_xx(a - (1ll << k));
        return tot;
    }
    if(a==1) return 1;
    if(a==2) return 3;
    return 0;
}

int main(){
    //freopen("c.in", "r", stdin);
    scanf("%d", &n);
    for(int i = 0; i < n; i ++){
        cin>>x>>m;
        ans ^= bit_xx( x + m - 1);
        ans ^= bit_xx( x - 1);
    }
    if(ans) puts("tolik");
    else puts("bolik");
}


#include<stdio.h>
#include<iostream>
using namespace std;

long long x, ans;
int n, m;

long long bit_xx(long long a, long long tot){
    if(a == 0) return 0;
    if(a==1) return 1;
    if(a==2) return 3;
    if(a==3) return 0;
    int k = 63 - __builtin_clzll(a);
    tot ^= (1 - a % 2) * (1ll << k);
    tot ^= bit_xx(a - (1ll << k), tot);
    return tot;
}

int main(){
    ans = 0;
    cin >> n;
    for(int i = 0; i < n; i ++){
        cin >> x >> m;
        ans ^= bit_xx( x + m - 1, 0);
        ans ^= bit_xx( x - 1, 0);
    }
    if(ans > 0) puts("tolik");
    else puts("bolik");
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

ll n;
ll x,m;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>x>>m;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
//        for(ll j=x;j<x+m;j++)
//        ans^=j;
        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

ll n;
ll x,y;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>y>>x;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
//        for(ll j=x;j<x+m;j++)
//        ans^=j;
        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

int n;
ll x,y;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        scanf("%lld%lld",&x,&y);
//        cout<<x<<" "<<y<<endl;
//        for(int j=x;j<=x+y;j++)
//        ans^=j;
        ans=ans^(f(y-1)^f(x+y-1));
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

ll n;
ll x,m;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>m>>x;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
        for(ll j=x;j<=x+m-1;j++)
        ans^=j;
//        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

ll n;
ll x,m;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>m>>x;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
        for(ll j=0;j<m;j++)
        ans^=(x+j);
//        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

int n;
ll x,y;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
        for(int j=y;j<=x+y-1;j++)
        ans^=j;
//        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

int n;
ll x,y;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
//        scanf("%i64d%i64d",&x,&y);
//        cout<<x<<" "<<y<<endl;
//        for(int j=y;j<=x+y-1;j++)
//        ans^=j;
        ans^=f(y-1)^f(x+y-1);
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }

#define bublic public
#define TynKogep TOPCODER
#define clr(a) memset(a,0,sizeof(a))
#define pb push_back
#define sz size()
#define ld long double
#define ll long long
#define mp make_pair
#define istr istringstream

const ld PI=3.1415926535897932384626433832795;
const ld EPS=1e-9;

int n;
ll x,y;

ll f(ll x)
{
    if (x%4==0) return x;
    if (x%4==1) return 1;
    if (x%4==2) return x+1;
    return 0;
}

int main()
{
//    freopen("q.in", "rt", stdin);
//    freopen("q.out", "wt", stdout);
    cout.flags(ios::fixed);
    cout.precision(2);
    cin>>n;
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        scanf("%lld%lld",&x,&y);
//        cout<<x<<" "<<y<<endl;
//        for(int j=x;j<=x+y;j++)
//        ans^=j;
        ans=ans^(f(x-1)^f(x+y));
    }
    if (ans) cout<<"tolik"; else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int x(int a, int b){
    int r=0;
    for(;a<=b;a++) if(a%4!=0){
        r ^= a;
    }
    for(;b>=a;b--) if(b%4!=3){
        r ^= b;
    }
    return r;
}

int y(int a, int b){
    int r=0;
    for(;a<=b;a++){
        r ^= a;
    }
    return r;
}

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, m, a, i;
    cin >> n;
    int r=0;
    int r2=0;
    for(i= 0 ;i<n ; i++){
        cin >> a >> m;
        if(m>10) r ^= x(a, a+m-1);
        else r ^= y(a, a+m-1);
        //r2 ^= y(a, a+m-1);
    }
    //cout<<r<< " " <<r2<<endl;
    if(r) cout<<"tolik";
    else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int x(int a, int b){
    int r=0;
    for(;a%4;a++)
        r ^= a;
    for(;b%4!=3;b--)
        r ^= b;
    return r;
}

int y(int a, int b){
    int r=0;
    for(;a<=b;a++){
        r ^= a;
    }
    return r;
}

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, m, a, i;
    cin >> n;
    int r=0;
    int r2=0;

    /*for(m=0 ; m<100 ; m++)
        for(n=m+9 ; n<100 ; n++){
            if(x(m, n) != y(m, n)) cout<<m<<" "<<n<<endl;
        }*/

    for(i= 0 ;i<n ; i++){
        cin >> a >> m;
        if(m>10) r ^= x(a, a+m-1);
        else r ^= y(a, a+m-1);
    }
    //cout<<r<< " " <<r2<<endl;
    if(r) cout<<"tolik";
    else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int compare (const void * a, const void * b)
{
  return ( *(int*)a - *(int*)b );
}

int gcd(int a, int b){
    if(a==0) return b;
    if(b==0) return a;
    if(a>b) return gcd(b, a%b);
    return gcd(a, b%a);
}

int x(int a, int b){
    int r=0;
    for(;a<=b;a++) if(a%4!=0){
        r ^= a;
    }
    for(;b>=a;b--) if(b%4!=3){
        r ^= b;
    }
    return r;
}

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, m, a, i;
    cin >> n;
    int r=0;
    for(i= 0 ;i<n ; i++){
        cin >> a >> m;
        r ^= x(a, a+m-1);
    }
    if(r) cout<<"tolik";
    else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, i, j;
    long long x, m;
    long long sum_xor = 0;
    cin>>n;
    for(i=0 ; i<n ; i++){
        cin >> x >> m;
        if(m<10) for(j=0; j<m ; j++) sum_xor ^= (x+j);
        else{
            for(j=0; j<m ; j++){
                if((x+j)%4==0) break;
                sum_xor ^= (x+j);
            }
            for(j=m-1; j>=0 ; j++){
                sum_xor ^= (x+j);
                if((x+j)%4==0) break;
            }
        }
    }
    if(sum_xor) cout<<"tolik";
    else cout<<"bolik";

    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, i, j;
    long long x, m;
    long long sum_xor = 0;
    cin>>n;
    for(i=0 ; i<n ; i++){
        cin >> x >> m;
        for(j=0; j<m ; j++) sum_xor ^= (x+j);
        /*if(m<10) for(j=0; j<m ; j++) sum_xor ^= (x+j);
        else{
            for(j=0; j<m ; j++){
                if((x+j)%4==0) break;
                sum_xor ^= (x+j);
            }
            for(j=m-1; j>=0 ; j++){
                sum_xor ^= (x+j);
                if((x+j)%4==0) break;
            }
        }*/
    }
    if(sum_xor) cout<<"tolik";
    else cout<<"bolik";

    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int compare (const void * a, const void * b)
{
  return ( *(int*)a - *(int*)b );
}

int gcd(int a, int b){
    if(a==0) return b;
    if(b==0) return a;
    if(a>b) return gcd(b, a%b);
    return gcd(a, b%a);
}

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n,x,m,i;
    int sum_xor = 0, M=0;
    cin>>n;
    for(i=0 ; i<n ; i++){
        cin >> x >> m;
        sum_xor ^= x;
        m = max(M, m);
    }
    for(i=1 ; i<M ; i++) sum_xor ^=i;
    if(sum_xor) cout<<"tolik";
    else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

long long x(long long a, long long b){
    long long r=0;
    for(;a%4;a++)
        r ^= a;
    for(;b%4!=3;b--)
        r ^= b;
    return r;
}

long long y(long long a, long long b){
    long long r=0;
    for(;a<=b;a++){
        r ^= a;
    }
    return r;
}

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, i;
    long long a , m;
    cin >> n;
    int r=0;
    int r2=0;

    /*for(m=0 ; m<100 ; m++)
        for(n=m+9 ; n<100 ; n++){
            if(x(m, n) != y(m, n)) cout<<m<<" "<<n<<endl;
        }*/

    for(i= 0 ;i<n ; i++){
        cin >> a >> m;
        if(m>10) r ^= x(a, a+m-1);
        else r ^= y(a, a+m-1);
    }
    //cout<<r<< " " <<r2<<endl;
    if(r) cout<<"tolik";
    else cout<<"bolik";
    return 0;
}


#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define INFY 1000000000
using namespace std;

int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n, x, m, i, j;
    int sum_xor = 0;
    cin>>n;
    for(i=0 ; i<n ; i++){
        cin >> x >> m;
        if(m<10) for(j=0; j<m ; j++) sum_xor ^= (x+j);
        else{
            for(j=0; j<m ; j++){
                if((x+j)%4==0) break;
                sum_xor ^= (x+j);
            }
            for(j=m-1; j>=0 ; j++){
                sum_xor ^= (x+j);
                if((x+j)%4==0) break;
            }
        }
    }
    if(sum_xor) cout<<"tolik";
    else cout<<"bolik";

    return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define MAXN 100010
#define INF 1000000007
#define MP(x,y) make_pair(x,y)
#define FI first
#define SE second
#define EPS 1e-8
using namespace std;
long long cal(long long n)
{
    int tmp=n%4;
    if(tmp==0)  n=n;
    else    if(tmp==1)  n=1;
    else    if(tmp==2)  ++n;
    else    n=0;
    return n;
}
int main()
{
    //freopen("/home/moor/Code/input","r",stdin);
    int n;
    long long x,m,ans=0;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%I64d%I64d",&x,&m);
        m+=x-1;
        --x;
        x=cal(x);
        m=cal(m);
        ans^=x^m;
    }
    printf("%s\n",ans?"tolik":"bolik");
    return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define MAXN 100010
#define INF 1000000007
#define MP(x,y) make_pair(x,y)
#define FI first
#define SE second
#define EPS 1e-8
using namespace std;
long long cal(long long n)
{
    int tmp=n%4;
    if(tmp==0)  n=n;
    else    if(tmp==1)  n=1;
    else    if(tmp==2)  ++n;
    else    n=0;
    return n;
}
int main()
{
    //freopen("/home/moor/Code/input","r",stdin);
    int n;
    long long x,m,ans=0;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%I64d%I64d",&x,&m);
        x=cal(x);
        m=cal(m);
        ans^=x^m;
    }
    printf("%s\n",ans?"tolik":"bolik");
    return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define MAXN 100010
#define INF 1000000007
#define MP(x,y) make_pair(x,y)
#define FI first
#define SE second
#define EPS 1e-8
using namespace std;
long long cal(long long n)
{
    int tmp=n%4;
    if(tmp==0)  n=n;
    else    if(tmp==1)  n=1;
    else    if(tmp==2)  ++n;
    else    n=0;
    return n;
}
int main()
{
    //freopen("/home/moor/Code/input","r",stdin);
    int n;
    long long x,m,ans=0;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%I64d%I64d",&x,&m);
        m+=x-1;
        x=cal(x);
        m=cal(m);
        ans^=x^m;
    }
    printf("%s\n",ans?"tolik":"bolik");
    return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define MAXN 100010
#define INF 1000000007
#define MP(x,y) make_pair(x,y)
#define FI first
#define SE second
#define EPS 1e-8
using namespace std;
int num[60]={0};
int main()
{
    //freopen("/home/moor/Code/input","r",stdin);
    int n;
    long long x,m;
    bool flag=0;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%I64d%I64d",&x,&m);
        m+=x-1;
        for(int i=0;m;++i,x>>=1,m>>=1)
            num[i]^=(x&1)^(m&1);
    }
    for(int i=0;i<60&&!flag;++i)
        if(num[i]!=0)
            flag=1;
    printf("%s\n",flag?"tolik":"bolik");
    return 0;
}


#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <set>
#define MAXN 100010
#define INF 1000000007
#define MP(x,y) make_pair(x,y)
#define FI first
#define SE second
#define EPS 1e-8
using namespace std;
int num[64]={0};
int main()
{
    //freopen("/home/moor/Code/input","r",stdin);
    int n;
    long long x,m,tmp;
    bool flag=0;
    scanf("%d",&n);
    while(n--)
    {
        //scanf("%lld%lld",&x,&m);
        scanf("%I64d%I64d",&x,&m);
        tmp=m;
        m+=x-1;
        for(int i=0;m;++i,x>>=1,m>>=1,tmp>>=1)
            num[i]^=(x&1)^(m&1)^(tmp&1);
    }
    for(int i=0;i<63&&!flag;++i)
        if(num[i]!=0)
            flag=1;
    printf("%s\n",flag?"tolik":"bolik");
    return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

long long XOR(long long tar)
{
	bool isOdd=false;
	if(tar%2) isOdd=true;

	long long ret=0;
	if(ret%4==1 || ret%4==2) ret=1;

	for(int i=1;i<64;i++)
	{
		if((tar/(1LL<<i))%2==0) continue;
		if(tar%(1LL<<i)%2==0) ret|=(1LL<<i);
	}

	return ret;
}

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		ans ^= (XOR(a+b-1) ^ XOR(a-1));
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>

using namespace std;

int main(void)
{
	int n;
	scanf("%d", &n);
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		scanf("%I64d %I64d", &a, &b);

		for(long long j=0;j<a;j++)
		{
			long long curVal = j+b;
			if(curVal>=3)
			{
				long long left=a-j;
				if(left%2) ans^=3;
				break;
			}
			else ans^=curVal;
		}
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		for(long long j=0;j<b;j++)
		{
			long long curVal = j+a;
			if(curVal>=2)
			{
				long long left=b-j;
				if(left%2) ans^=2;
				break;
			}
			else ans^=curVal;
		}
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

long long XOR(long long tar)
{
	long long ret=0;
	if(tar%4==1 || tar%4==2) ret=1;

	for(int i=1;i<63;i++)
	{
		if(tar<(1LL<<i)) break;
		if((tar/(1LL<<i))%2==0) continue;
		if((tar%(1LL<<i))%2==0) ret|=(1LL<<i);
	}

	return ret;
}

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		ans ^= (XOR(a+b-1) ^ XOR(a-1));
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

long long XOR(long long tar)
{
	bool isOdd=false;
	if(tar%2) isOdd=true;

	long long ret=0;
	if(ret%4==1 || ret%4==2) ret=1;

	for(int i=1;i<64;i++)
	{
		if(tar<(1LL<<i)) break;
		if((tar/(1LL<<i))%2==0) continue;
		if(tar%(1LL<<i)%2==0) ret|=(1LL<<i);
	}

	return ret;
}

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		ans ^= (XOR(a+b-1) ^ XOR(a-1));
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		for(long long j=0;j<a;j++)
		{
			long long curVal = j+b;
			if(curVal>=2)
			{
				long long left=a-j;
				if(left%2) ans^=2;
				break;
			}
			else ans^=curVal;
		}
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

long long XOR(long long tar)
{
	bool isOdd=false;
	if(tar%2) isOdd=true;

	long long ret=0;
	if(ret%4==1 || ret%4==2) ret=1;

	for(int i=1;i<63;i++)
	{
		if(tar<(1LL<<i)) break;
		if((tar/(1LL<<i))%2==0) continue;
		if((tar%(1LL<<i))%2==0) ret|=(1LL<<i);
	}

	return ret;
}

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		ans ^= (XOR(a+b-1) ^ XOR(a-1));
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <cstdio>
#include <iostream>

using namespace std;

int main(void)
{
	int n;
	cin>>n;
	long long ans=0;
	for(int i=0;i<n;i++)
	{
		long long a, b;
		cin>>a>>b;

		for(long long j=0;j<b;j++)
		{
			long long curVal = j+a;
			if(curVal>=3)
			{
				long long left=b-j;
				if(left%2) ans^=3;
				break;
			}
			else ans^=curVal;
		}
	}

	if(ans) printf("tolik\n");
	else printf("bolik\n");

	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n,m,t,x;
    while(cin >> n)
    {
        t = 0;
        while(n--)
        {
            cin >> x >> m;
            while(m--)
            {
                t = t ^ x;
                x++;
            }
        }
        if(t)
        cout << "tolik" << endl;
        else
        cout << "bolik" << endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    __int64 n,m,t,x;
    while(cin >> n)
    {
        t = 0;
        while(n--)
        {
            cin >> x >> m;
            while(m--)
            {
                t = t ^ x;
                x++;
            }
        }
        if(t)
        cout << "tolik" << endl;
        else
        cout << "bolik" << endl;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    long long n,m,t,x;
    while(cin >> n)
    {
        t = 0;
        while(n--)
        {
            cin >> x >> m;
            if(x%2)
            {
                t ^= x;
                if(m%2)
                    t^=((m-1)/2)%2;
                else
                {
                    t^=((m-2)/2)%2;
                    t^=(x+m-1);
                }
            }
            else
            {
                if(m%2==0)
                t ^= m/2%2;
                else
                t ^= (m/2%2)^(x+m-1);
            }
        }
        if(t)
        cout << "tolik" << endl;
        else
        cout << "bolik" << endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cctype>

using namespace std;
typedef unsigned long long int64;
const int inf = 0x3f3f3f3f;
typedef double real;
const real eps = 1e-6;
typedef pair<int,int> pip;
#define Eo(x) { cerr << #x << " = " << (x) << endl; }

const int maxn = 128;
int a[maxn];

int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		int64 m,x; cin >> m >> x;
		int64 q = 2;
		for (int j = 0; j < 63; j++, q <<= 1){
			int64 numones = 0;
			int64 r = x%q;
			int64 fin = x+m;
			int64 tonext = (q-r)%q;
			if ((fin/q) == (x/q)){
				fin = fin%q;
				fin = max(fin,q/2);
				r = max(r,q/2);
				numones += fin-r;
			} else {
				r = max(r,q/2);
				r = q-r;
				numones += r;

				int64 v = x+tonext;
				int64 full = (x+m-v)/q;
				int64 perper = q/2;
				perper &= 1;
				numones += perper*full;

				int64 g = fin%q;
				g = max(g,q/2);
				numones += g-q/2;
			}
			numones &= 1;
			a[j] ^= numones;
		}
	}
	bool any = false;
	for (int i = 0; i < maxn; i++)
		if (a[i]) any = true;
	puts(any ? "tolik" : "bolik");
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cctype>

using namespace std;
typedef unsigned long long int64;
const int inf = 0x3f3f3f3f;
typedef double real;
const real eps = 1e-6;
typedef pair<int,int> pip;
#define Eo(x) { cerr << #x << " = " << (x) << endl; }

const int maxn = 128;
int a[maxn];

int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		int64 m,x; cin >> m >> x;
		int64 q = 2;
		for (int j = 0; j < 63; j++, q <<= 1){
			int64 numones = 0;
			int64 r = x%q;
			int64 tonext = (q-r)%q;
			if (tonext > m){
				int64 fin = (x+m)%q;
				fin = max(fin,q/2);
				r = max(r,q/2);
				numones += fin-r;
			} else {
				r = max(r,q/2);
				r = q-r;
				numones += r;

				int64 v = x+tonext;
				int64 full = (x+m-v)/q;
				int64 perper = q/2;
				numones += perper*full;

				int64 fin = x+m;
				int64 g = fin%q;
				g = max(g,q/2);
				numones += g-q/2;
			}
			numones &= 1;
			a[j] ^= numones;
		}
	}
	bool any = false;
	for (int i = 0; i < maxn; i++)
		if (a[i]) any = true;
	puts(any ? "tolik" : "bolik");
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cctype>

using namespace std;
typedef unsigned long long int64;
const int inf = 0x3f3f3f3f;
typedef double real;
const real eps = 1e-6;
typedef pair<int,int> pip;
#define Eo(x)
//{ cerr << #x << " = " << (x) << endl; }

const int maxn = 128;
int a[maxn];

int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		int64 m,x; cin >> m >> x;
		int64 q = 2;
		for (int j = 0; j < 62; j++, q <<= 1){
			int64 numones = 0;
			int64 r = x%q;
			int64 fin = x+m;
			int64 tonext = (q-r)%q;
			if ((fin/q) == (x/q)){
				fin = fin%q;
				fin = max(fin,q/2);
				r = max(r,q/2);
				numones += fin-r;
			} else {
				if (r){
					r = max(r,q/2);
					r = q-r;
					numones += r;
				}

				int64 v = x+tonext;
				int64 full = (x+m-v)/q;
				Eo(full);
				int64 perper = q/2;
					perper &= 1;
				numones += perper*full;
				Eo(numones);

				int64 g = fin%q;
				g = max(g,q/2);
				numones += g-q/2;
			}
			Eo(numones);
			numones &= 1;
			a[j] ^= numones;
		}
	}
	bool any = false;
	for (int i = 0; i < maxn; i++)
		if (a[i]) any = true;
	puts(any ? "tolik" : "bolik");
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cctype>

using namespace std;
typedef unsigned long long int64;
const int inf = 0x3f3f3f3f;
typedef double real;
const real eps = 1e-6;
typedef pair<int,int> pip;
#define Eo(x)
//{ cerr << #x << " = " << (x) << endl; }

const int maxn = 128;
int a[maxn];

int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		int64 m,x; cin >> m >> x;
		int64 q = 2;
		for (int j = 0; j < 10; j++, q <<= 1){
			Eo(j);
			int64 numones = 0;
			int64 r = x%q;
			int64 fin = x+m;
			int64 tonext = (q-r)%q;
			if ((fin/q) == (x/q)){
				fin = fin%q;
				fin = max(fin,q/2);
				r = max(r,q/2);
				numones += fin-r;
			} else {
				if (r){
					r = max(r,q/2);
					r = q-r;
					numones += r;
				}

				int64 v = x+tonext;
				int64 full = (x+m-v)/q;
				Eo(full);
				int64 perper = q/2;
				//				perper &= 1;
				numones += perper*full;
				Eo(numones);

				int64 g = fin%q;
				g = max(g,q/2);
				numones += g-q/2;
			}
			Eo(numones);
			numones &= 1;
			a[j] ^= numones;
		}
	}
	bool any = false;
	for (int i = 0; i < maxn; i++)
		if (a[i]) any = true;
	puts(any ? "tolik" : "bolik");
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <cctype>

using namespace std;
typedef unsigned long long int64;
const int inf = 0x3f3f3f3f;
typedef double real;
const real eps = 1e-6;
typedef pair<int,int> pip;
#define Eo(x)
//{ cerr << #x << " = " << (x) << endl; }

const int maxn = 128;
int a[maxn];

int main(){
	int n; cin >> n;
	for (int i = 0; i < n; i++){
		int64 m,x; cin >> x >> m;
		int64 q = 2;
		Eo(x);
		for (int j = 0; j < 6; j++, q <<= 1){
			Eo(j);
			int64 numones = 0;
			int64 r = x%q;
			int64 fin = x+m;
			int64 tonext = (q-r)%q;
			if ((fin/q) == (x/q)){
				fin = fin%q;
				fin = max(fin,q/2);
				r = max(r,q/2);
				numones += fin-r;
			} else {
				if (r){
					r = max(r,q/2);
					r = q-r;
					numones += r;
				}

				int64 v = x+tonext;
				int64 full = (x+m-v)/q;
				Eo(full);
				int64 perper = q/2;
				//	perper &= 1;
				numones += perper*full;
				Eo(numones);

				int64 g = fin%q;
				g = max(g,q/2);
				numones += g-q/2;
			}
			Eo(numones);
			numones &= 1;
			a[j] ^= numones;
		}
	}
	bool any = false;
	for (int i = 0; i < maxn; i++)
		if (a[i]) any = true;
	puts(any ? "tolik" : "bolik");
	return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

#define MP make_pair
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

LL calc(LL x) {
    LL ret=0, y=x+1;
    REP(i,60) {
        LL t=1ll<<i+1, cnt=(y>>i+1)<<i;
        if (x<(1ll<<i)) break;
        if (y%t>(1ll<<i)) cnt+=y%t-(1ll<<i);
        if (cnt&1) ret|=1<<i;
    }
    return ret;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        LL s=0;
        REP(i,n) {
            LL x, m;
            scanf("%I64d%I64d", &x, &m);
            s^=calc(x+m-1)^calc(x-1);
        }
        if (s) puts("tolik");
        else puts("bolik");
    }
    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

#define MP make_pair
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

LL calc(LL x) {
    LL ret=0;
    ++x;
    REP(i,63) {
        LL t=1ll<<i+1, cnt=(x>>i+1)<<i;
        if (x%t>(1ll<<i)) cnt+=x%t-(1ll<<i);
        if (cnt&1) ret|=1<<i;
    }
    return ret;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        LL s=0;
        REP(i,n) {
            LL x, m;
            scanf("%I64d%I64d", &x, &m);
            s^=calc(x+m-1)^calc(x-1);
        }
        if (s) puts("tolik");
        else puts("bolik");
    }
    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

#define MP make_pair
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

LL calc(LL x) {
    LL ret=0;
    ++x;
    REP(i,63) {
        LL t=1ll<<i+1, cnt=(x>>i+1)<<i;
        if (x<t) break;
        if (x%t>(1ll<<i)) cnt+=x%t-(1ll<<i);
        if (cnt&1) ret|=1<<i;
    }
    return ret;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        LL s=0;
        REP(i,n) {
            LL x, m;
            scanf("%I64d%I64d", &x, &m);
            s^=calc(x+m-1)^calc(x-1);
        }
        if (s) puts("tolik");
        else puts("bolik");
    }
    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

#define MP make_pair
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

LL calc(LL x) {
    LL ret=0, y=x+1;
    REP(i,60) {
        LL t=1ll<<i+1, cnt=(y>>i+1)<<i;
        if (x<(1ll<<i)) break;
        if (y%t>(1ll<<i)) cnt+=y%t-(1ll<<i);
        if (cnt&1) ret|=1ll<<i;
    }
    return ret;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        LL s=0;
        REP(i,n) {
            LL x, m;
            scanf("%I64d%I64d", &x, &m);
            s^=calc(x+m-1)^calc(x-1);
        }
        if (s) puts("tolik");
        else puts("bolik");
    }
    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

#define MP make_pair
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

LL calc(LL x) {
    LL y=x%4;
    if (y == 0) return x;
    else if (y == 1) return 1;
    else if (y == 2) return x+1;
    else return 0;
}

int main() {
    int n;
    while (~scanf("%d", &n)) {
        LL s=0;
        REP(i,n) {
            LL x, m;
            scanf("%I64d%I64d", &x, &m);
            s^=calc(x+m-1)^calc(x-1);
        }
        if (s) puts("tolik");
        else puts("bolik");
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
int n;
ll ans,m,x;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%lld%lld",&m,&x);
		for(int j=1;j<=m;++j)
		{
			ans^=(x+j-1);
		}
	}
	if(!ans)printf("bolik");
	else printf("tolik");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
int n;
ll ans,m,x;
ll calc(ll a)
{
	if(a&3==3)return 0;
	else if(!(a&3))return a;
	else if(a&3==1)return 1;
	else return a+1;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%lld%lld",&m,&x);
		ans^=(calc(m-1)^calc(x+m-1));
	}
	if(!ans)printf("bolik");
	else printf("tolik");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
int n;
ll ans,m,x;
ll calc(ll a)
{
	if(a%4==3)return 0;
	else if(a%4==0)return a;
	else if(a%4==1)return 1;
	else if(a%4==2)return a+1;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%I64d%I64d",&m,&x);
		ans^=(calc(m-1)^calc(x+m-1));
	}
	if(!ans)printf("bolik");
	else printf("tolik");
	return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,-1});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i])*2;
            int o=s.order_of_key({x,-1});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=abs(x);
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,-1});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,-1});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=a[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(a[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo),cmp1);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo),cmp2);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=a[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo),cmp1);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo),cmp2);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      map<int,int> cnt;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12})-cnt[pos[i]];
            ans+=o;
            s.insert({pos[i],i});
            cnt[pos[i]]++;
      }
      s.clear();
      map<int,int> cnt1;
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i])*2;
            int o=s.order_of_key({x,1e12})-cnt1[abs(neg[i])];
            ans+=o;
            s.insert({abs(neg[i]),i});
            cnt1[abs(neg[i])]++;
      }
      s.clear();
      for(auto &x:neg){
            x=abs(x);
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      cnt.clear();
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12})-cnt[oo[i].fi];
            }
            else{
                  s.insert({oo[i].fi,i});
                  cnt[oo[i].fi]++;
            }
      }
      s.clear();
      sort(all(oo));
      cnt.clear();
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
                cnt[oo[i].fi]++;
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12})-cnt[oo[i].fi];
            }
      }
      cout<<ans;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=a[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i]*2);
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=-x;
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo),cmp2);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo),cmp1);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i])*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=abs(x);
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo),cmp1);
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo),cmp2);
      map<int,int> ma;
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
                ma[oo[i].fi]++;
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12})-ma[oo[i].fi];
            }
      }

      cout<<ans;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<(n);i++)
const int MOD = 1e9 + 7 ;
const int N=1e7+3;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ordered_set s;
bool cmp1(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se>b.se;
      }
      return a.fi<b.fi;
}

bool cmp2(pii a,pii b)
{
      if(a.fi==b.fi)
      {
            return a.se<b.se;
      }
      return a.fi<b.fi;
}
int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n;
      cin>>n;
      int a[n];
      vector<int> pos,neg;
      forn(i,n)
      {
            cin>>a[i];
            if(a[i]>=0)
            {
                  pos.pb(a[i]);
            }
            else{
                  neg.pb(a[i]);
            }
      }
      sort(all(pos));
      sort(all(neg));
      int ans=0;
      for(int i=(int)pos.size()-1;i>=0;i--)
      {
            int x=pos[i]*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({pos[i],i});
      }
      s.clear();
      for(int i=(int)neg.size()-1;i>=0;i--)
      {
            int x=abs(neg[i])*2;
            int o=s.order_of_key({x,1e12});
            ans+=o;
            s.insert({abs(neg[i]),i});
      }
      s.clear();
      for(auto &x:neg){
            x=abs(x);
      }
      // for(int i=0;i<(int)neg.size();i++)
      // {
      //       s.insert({neg[i],i});
      // }
      // for(auto x:pos){
      //       ans+=s.order_of_key({2*x,1e12});
      // }
      // s.clear();
      vector<pair<int,int>> oo;
      for(auto x:neg){
            oo.pb({x,-1});
      }
      for(auto x:pos)
      {
            oo.pb({x,1});
      }
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                  ans+=s.order_of_key({2*oo[i].fi,-1});
            }
            else{
                  s.insert({oo[i].fi,i});
            }
      }
      s.clear();
      sort(all(oo));
      for(int i=(int)oo.size()-1;i>=0;i--)
      {
            if(oo[i].se==1)
            {
                s.insert({oo[i].fi,i});
            }
            else{
                  ans+=s.order_of_key({2*oo[i].fi,1e12});
            }
      }

      cout<<ans;

}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        for(long j=i+1;j<n;j++){
            if(a[j]<=2*a[i])
                count++;
            else break;
        }
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    long j=1;
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        // if(a[i]==a[i-1]&&i<n-1)
        //     count--;

        while(a[j]<=2*a[i] && j<n)
            j++;
        count+=j-i-1;
    }
    printf("%lld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    long j=1;
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        // if(a[i]==a[i-1]&&i<n-1)
        //     count--;

        while(a[j]<=2*a[i] && j<n)
            j++;
        count+=j-i-1;
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        // if(a[i]==a[i-1]&&i<n-1)
        //     count--;
        long val=2*a[i];
        long h=n-1,l=i+1,j=(l+h)/2;
        while(l<h){
            if(a[j]==val){
                l=h=j;
            }
            else{
                if(a[j]<val){
                    l=j+1;
                }
                else{
                    h=j-1;
                }
                j=(l+h)/2;
            }
        }
        count+=j-i-(val<a[j])-(val<a[j-1]&&j>0);
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        // if(a[i]==a[i-1]&&i<n-1)
        //     count--;
        long val=2*a[i];
        long h=n-1,l=i+1,j=(l+h)/2;
        while(l<h){
            if(a[j]==val){
                l=h=j;
            }
            else{
                if(a[j]<val){
                    l=j+1;
                }
                else{
                    h=j-1;
                }
                j=(l+h)/2;
            }
        }
        count+=j-i-(val<a[j])-(val<a[j-1]&&j>0);
    }
    printf("%lld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        // if(a[i]==a[i-1]&&i<n-1)
        //     count--;
        long val=2*a[i];
        long h=n-1,l=i+1,j=(l+1)/2+(h+1)/2;
        while(l<h){
            if(a[j]==val){
                l=h=j;
            }
            else{
                if(a[j]<val){
                    l=j+1;
                }
                else{
                    h=j-1;
                }
                j=(l+h)/2;
            }
        }
        count+=j-i-(val<a[j])-(val<a[j-1]&&j>0);
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long l,u,l2,u2;
    long count=0;
    for(long i=0;i<n;i++)
        scanf("%ld",&a[i]);
    for(long i=0;i<n;i++){
        for(long j=i+1;j<n;j++){
            l=min(abs(a[i]),abs(a[j]));
            u=max(abs(a[i]),abs(a[j]));
            l2=min(abs(a[i]+a[j]),abs(a[i]-a[j]));
            u2=max(abs(a[i]+a[j]),abs(a[i]-a[j]));
            if(l2<=l&&u2>=u)
                count++;
        }
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        if(a[i]==a[i-1]&&i<n-1)
            count--;
        long val=2*a[i];
        long h=n-1,l=i+1,j=(l+h)/2;
        while(l<h){
            if(a[j]==val){
                l=h=j;
            }
            else{
                if(a[j]<val){
                    l=j+1;
                }
                else{
                    h=j-1;
                }
                j=(l+h)/2;
            }
        }
        count+=j-i-(val<a[j])-(val<a[j-1]&&j>0);
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long l,u,l2,u2;
    long count=0;
    for(long i=0;i<n;i++)
        scanf("%ld",&a[i]);
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        for(long j=i+1;j<n;j++){
            l=min(abs(a[i]),abs(a[j]));
            u=max(abs(a[i]),abs(a[j]));
            if(u<=2*l)
                count++;
            else
                break;
        }
    }
    printf("%ld",count);
}


#include<bits/stdc++.h>
using namespace std;
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long l,u,l2,u2;
    long count=0;
    for(long i=0;i<n;i++)
        scanf("%ld",&a[i]);
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        for(long j=i+1;j<n;j++){
            l=min(abs(a[i]),abs(a[j]));
            u=max(abs(a[i]),abs(a[j]));
            if(u<2*l)
                count++;
            else
                break;
        }
    }
    printf("%ld",count);
}


// m*C(n-1,k)*((m-1)^k)
#include<bits/stdc++.h>
using namespace std;
long long nCr(int n,int r,long long p){
    long long c[r+1];
    memset(c,0,sizeof(c));
    c[0]=1;
    for(int i=1;i<=n;i++){
        for(int j=min(i,r);j>0;j--){
            c[j]=(c[j]+c[j-1])%p;
        }
    }
    return c[r];
}
#include<bits/stdc++.h>
int main(){
    long long p=998244353;
    int n,m,k;
    scanf("%d %d %d",&n,&m,&k);
    long long var=1;
    for(int i=0;i<k;i++){
        var=(var*(m-1))%p;
    }
    // for(int i=0;i<k-k%3;i+=3){
    //     var=(var*((m-1)*(m-1)*(m-1))%p)%p;
    // }
    // for(int i=0;i<k%3;i++)
    //     var=(var*(m-1))%p;
    long long val=nCr(n-1,k,p);
    // printf("val=%lld var=%lld\n",val%p,var%p);
    long long final_varXval=0;
    for(long long i=0;i<val/100;i++){
        final_varXval=(final_varXval+100*var)%p;
    }
    final_varXval=(final_varXval+(val%100)*var)%p;
    long long ans=(m*final_varXval)%p;
    printf("%lld",ans);
}


#include<bits/stdc++.h>
using namespace std;

int comp(long a,long b){
    return abs(a)<abs(b);
}
int main(){

    long n;
    scanf("%ld",&n);
    long a[n+10];
    long count=0;
    for(long i=0;i<n;i++){
        scanf("%ld",&a[i]);
        a[i]=abs(a[i]);
    }
    sort(a,a+n);
    // for(int i=0;i<n;i++)
    //     printf("%ld",a[i]);
    for(long i=0;i<n;i++){
        long val=2*a[i];
        long h=n-1,l=i+1,j=(l+h)/2;
        while(l<h){
            if(a[j]==val){
                l=h=j;
            }
            else{
                if(a[j]<val){
                    l=j+1;
                }
                else{
                    h=j-1;
                }
                j=(l+h)/2;
            }
        }
        count+=j-i-(val<a[j])-(val<a[j-1]);
    }
    printf("%ld",count);
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),ceil((long double)pos[i]/2));
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),ceil((long double)neg[i]/2));
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				if((*itr)<=2*neg[i]  && (*itr)>=neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));
				if (itr==pos.end())
				{
					itr--;
				}
				if ((*itr)<=neg[i] && (*itr)>=ceil((long double)neg[i]/2))
				{
					ans+=((itr1-pos.begin())-(itr-pos.begin()));
				}

				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);

			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=upper_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=upper_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=upper_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=upper_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i] && (*itr)>=ceil((long double)neg[i]/2))
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}

				}
				//debug(ans);
				itr=upper_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);

			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		if (itr==pos.end())
		{
			itr--;
		}
		if((*itr)>2*pos[i] && itr!=pos.begin())
			itr--;
		if((*itr)<=2*pos[i] && ((*itr)>=pos[i]))
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i] && itr!=neg.begin())
			itr--;
		if((*itr)<=2*neg[i] && (*itr)>=neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			if ((*itr1)<=2*neg[i] && (*itr1)>=ceil((long double)neg[i]/2))
			{
				itr=lower_bound(pos.begin(),pos.end(),ceil((long double)neg[i]/2));

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i]  && itr!=pos.begin())
					itr--;
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin())+1);
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
		if (x>0)
		{
			arr.push_back(x);
		}
		if (x<0)
		{
			arr.push_back(x*-1);
		}
	}
	sort(arr.begin(), arr.end());

	long long ans=0;
	vector<long long>::iterator itr;
	for (int i = 0; i < arr.size(); ++i)
	{
		itr=lower_bound(arr.begin(),arr.end(),2*arr[i]);
		if (itr==arr.end())
		{
			itr--;
		}
		if((*itr)>2*arr[i] && itr!=arr.begin())
			itr--;
		if((*itr)<=2*arr[i] && ((*itr)>=arr[i]))
			ans+=((itr-arr.begin())-i);

	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	long long n,x;
	cin >> n;
	vector<long long>arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		arr.push_back(abs(x));
	}
	sort(arr.begin(), arr.end());

	long long ans=0;
	vector<long long>::iterator itr;
	for (int i = 0; i < arr.size(); ++i)
	{
		itr=lower_bound(arr.begin(),arr.end(),2*arr[i]);
		if (itr==arr.end())
		{
			itr--;
		}
		if((*itr)>2*arr[i] && itr!=arr.begin())
			itr--;
		if((*itr)<=2*arr[i])
			ans+=((itr-arr.begin())-i);

	}
	cout << ans << "\n";
	return 0;
}


#include <bits/stdc++.h>
#define debug(x) cout << "value of " << #x << " "<< x << "\n";

using namespace std;

int main(int argc, char const *argv[])
{
	int n,x;
	cin >> n;
	vector<long long>pos,neg,arr;
	for (int i = 0; i < n; ++i)
	{
		cin >> x;
		if (x==0)
			continue;
		else
			arr.push_back(x);
		if (x>0)
		{
			pos.push_back(x);
		}
		if (x<0)
		{
			neg.push_back(x);
		}
	}
	sort(arr.begin(), arr.end());
	sort(pos.begin(),pos.end());

	for (int i = 0; i < neg.size(); ++i)
	{

		neg[i]=neg[i]*-1;
	}
	sort(neg.begin(),neg.end());

	long long ans=0,posans=0,negans=0;
	vector<long long>::iterator itr,itr1;
	for (int i = 0; i < pos.size(); ++i)
	{
		long long tmp;
		tmp=pos[i]/2;
		if (pos[i]%2!=0)
			tmp++;

		itr=lower_bound(pos.begin(),pos.end(),tmp);
		//cout << "pos " << pos[i] << "\n";
		//cout << "val: " << ceil((long double)pos[i]/2) << "\n";
		//cout << "fs: " << *itr << "\n";
		if (itr!=pos.end())
		{
			if((*itr)<pos[i])
				posans+=(i-(itr-pos.begin()));
		}
		//debug(posans);
		itr=lower_bound(pos.begin(),pos.end(),2*pos[i]);
		//cout << "val: " << 2*pos[i] << "\n";
		//cout << "ss: " << *itr << "\n";
		if (itr==pos.end())
		{
			itr--;
			//cout <<"here\n";
		}
		if((*itr)>2*pos[i])
			itr--;
		if((*itr)<=2*pos[i])
			posans+=((itr-pos.begin())-i);
		//debug(posans);

	}
	ans+=(posans/2);
	//cout << "aftr pos\n";
	//debug(ans);

	for (int i = 0; i < neg.size(); ++i)
	{
		long long tmp;
		tmp=neg[i]/2;
		if (neg[i]%2!=0)
			tmp++;

		itr=lower_bound(neg.begin(),neg.end(),tmp);
		if(itr!=neg.end()){
			if((*itr)<neg[i])
				negans+=(i-(itr-neg.begin()));
		}
		itr=lower_bound(neg.begin(),neg.end(),2*neg[i]);
		if (itr==neg.end())
		{
			itr--;
		}
		if((*itr)>2*neg[i])
			itr--;
		if((*itr)<=2*neg[i])
			negans+=((itr-neg.begin())-i);

	}
	ans+=(negans/2);
	//cout << "after neg\n";
	//debug(ans);
	if(pos.size()>0){
		for (int i = 0; i < neg.size(); ++i)
		{
			itr1=lower_bound(pos.begin(), pos.end(),neg[i]);
			if (itr1==pos.end())
			{
				itr1--;
			}
			long long tmp;
			tmp=neg[i]/2;
			if (neg[i]%2!=0)
				tmp++;

			if ((*itr1)<=2*neg[i] && (*itr1)>=tmp)
			{
				itr=lower_bound(pos.begin(),pos.end(),tmp);

				if (itr!=pos.end())
				{
					if ((*itr)<=neg[i])
					{
						ans+=((itr1-pos.begin())-(itr-pos.begin()));
					}
				}
				//debug(ans);
				itr=lower_bound(pos.begin(),pos.end(),2*neg[i]);
				if (itr==pos.end())
				{
					itr--;
					//cout << "here\n";
				}
				if((*itr)>2*neg[i])
					itr--;
				if((*itr)<=2*neg[i])
					ans+=((itr-pos.begin())-(itr1-pos.begin()));
				if ((*itr1)==neg[i])
					{
						ans++;
					}
				//debug(ans);
			}

		}
	}

	///cout << "after mixed\n";
	//debug(ans);
	cout << ans << "\n";
	return 0;
}