#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair

using namespace std;

namespace fft
{
    struct num
    {
        double x,y;
        num() {x=y=0;}
        num(double x,double y):x(x),y(y){}
    };
    inline num operator+(num a,num b) {return num(a.x+b.x,a.y+b.y);}
    inline num operator-(num a,num b) {return num(a.x-b.x,a.y-b.y);}
    inline num operator*(num a,num b) {return num(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline num conj(num a) {return num(a.x,-a.y);}

    int base=1;
    vector<num> roots={{0,0},{1,0}};
    vector<int> rev={0,1};
    const double PI=acosl(-1.0);

    void ensure_base(int nbase)
    {
        if(nbase<=base) return;
        rev.resize(1<<nbase);
        for(int i=0;i<(1<<nbase);i++)
            rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
        roots.resize(1<<nbase);
        while(base<nbase)
        {
            double angle=2*PI/(1<<(base+1));
            for(int i=1<<(base-1);i<(1<<base);i++)
            {
                roots[i<<1]=roots[i];
                double angle_i=angle*(2*i+1-(1<<base));
                roots[(i<<1)+1]=num(cos(angle_i),sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<num> &a,int n=-1)
    {
        if(n==-1) n=a.size();
        assert((n&(n-1))==0);
        int zeros=__builtin_ctz(n);
        ensure_base(zeros);
        int shift=base-zeros;
        for(int i=0;i<n;i++)
            if(i<(rev[i]>>shift))
                swap(a[i],a[rev[i]>>shift]);
        for(int k=1;k<n;k<<=1)
        {
            for(int i=0;i<n;i+=2*k)
            {
                for(int j=0;j<k;j++)
                {
                    num z=a[i+j+k]*roots[j+k];
                    a[i+j+k]=a[i+j]-z;
                    a[i+j]=a[i+j]+z;
                }
            }
        }
    }

    vector<num> fa,fb;

    vector<int> multiply(vector<int> &a, vector<int> &b)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<sz;i++)
        {
            int x=(i<(int)a.size()?a[i]:0);
            int y=(i<(int)b.size()?b[i]:0);
            fa[i]=num(x,y);
        }
        fft(fa,sz);
        num r(0,-0.25/sz);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num z=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
            if(i!=j) fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
            fa[i]=z;
        }
        fft(fa,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++) res[i]=fa[i].x + (fa[i].x > 0 ? 0.5 : -0.5);
        return res;
    }

    vector<int> multiply_mod(vector<int> &a,vector<int> &b,int m,int eq=0)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<(int)a.size();i++)
        {
            int x=(a[i]%m+m)%m;
            fa[i]=num(x&((1<<15)-1),x>>15);
        }
        fill(fa.begin()+a.size(),fa.begin()+sz,num{0,0});
        fft(fa,sz);
        if(sz>(int)fb.size()) fb.resize(sz);
        if(eq) copy(fa.begin(),fa.begin()+sz,fb.begin());
        else
        {
            for(int i=0;i<(int)b.size();i++)
            {
                int x=(b[i]%m+m)%m;
                fb[i]=num(x&((1<<15)-1),x>>15);
            }
            fill(fb.begin()+b.size(),fb.begin()+sz,num{0,0});
            fft(fb,sz);
        }
        double ratio=0.25/sz;
        num r2(0,-1),r3(ratio,0),r4(0,-ratio),r5(0,1);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num a1=(fa[i]+conj(fa[j]));
            num a2=(fa[i]-conj(fa[j]))*r2;
            num b1=(fb[i]+conj(fb[j]))*r3;
            num b2=(fb[i]-conj(fb[j]))*r4;
            if(i!=j)
            {
                num c1=(fa[j]+conj(fa[i]));
                num c2=(fa[j]-conj(fa[i]))*r2;
                num d1=(fb[j]+conj(fb[i]))*r3;
                num d2=(fb[j]-conj(fb[i]))*r4;
                fa[i]=c1*d1+c2*d2*r5;
                fb[i]=c1*d2+c2*d1;
            }
            fa[j]=a1*b1+a2*b2*r5;
            fb[j]=a1*b2+a2*b1;
        }
        fft(fa,sz);fft(fb,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++)
        {
            ll aa=fa[i].x+0.5;
            ll bb=fb[i].x+0.5;
            ll cc=fa[i].y+0.5;
            res[i]=(aa+((bb%m)<<15)+((cc%m)<<30))%m;
        }
        return res;
    }
    vector<int> square_mod(vector<int> &a,int m)
    {
        return multiply_mod(a,a,m,1);
    }
};
vector < int > power(vector < int > v , int p)
{
    if(p == 1) return v;
    vector < int > a = power(v , p >> 1);
    a = fft::multiply(a , a);
    //for(auto &x : a)if( x > 1 ) x = 1;
    if(p&1)
    {
        a = fft::multiply(a , v);
        //for(auto &x : a)if( x > 1 ) x = 1;
    }
    return a;
}

const int N = 2e5 + 5;
const int BLOCK = 650;
const int PARTS = N/BLOCK + 1;

string A , B;
vector < int > a , b[PARTS] , c[PARTS] , temp;
int n , m;

int main()
{
    ios::sync_with_stdio(false);    cin.tie(NULL);  cout.tie(NULL);

    bool swapped = false;
    cin >> A >> B;

    if(A.size() < B.size()) swap(A,B) , swapped = true;

    n = A.size();
    m = B.size();

    for(int i = 0 ; i < n ; i++)    a.push_back(A[i] == '1' ? 1 : -1);
    for(int i = 0 ; i < m ; i++)    b[i/BLOCK].push_back(B[i] == '1' ? 1 : -1);

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) reverse(b[i].begin(),b[i].end());

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++)
    {
        temp = fft::multiply(a,b[i]);
        for(int j = BLOCK-1 ; j < n; j++)
            c[i].push_back(temp[j]);
    }

    int q;  cin >> q;
    while(q--)
    {
        int p1 , p2 , len;  cin >> p1 >> p2 >> len; if(swapped) swap(p1,p2);
        assert(len > 0);

        int ans = 0;
        for(int j = p2/BLOCK ; j <= (p2+len-1)/BLOCK ; j++)
        {
            int l = max(p2,j*BLOCK);
            int r = min(p2+len,(j+1)*BLOCK);

            if(l == j*BLOCK && r == (j+1)*BLOCK)    ans += (BLOCK - c[j][r-1+p1-p2-BLOCK+1])/2;
            else
                for(int i = l ; i < r ; i++)        ans += (A[i+p1-p2] != B[i]);
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair

using namespace std;

namespace fft
{
    struct num
    {
        double x,y;
        num() {x=y=0;}
        num(double x,double y):x(x),y(y){}
    };
    inline num operator+(num a,num b) {return num(a.x+b.x,a.y+b.y);}
    inline num operator-(num a,num b) {return num(a.x-b.x,a.y-b.y);}
    inline num operator*(num a,num b) {return num(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline num conj(num a) {return num(a.x,-a.y);}

    int base=1;
    vector<num> roots={{0,0},{1,0}};
    vector<int> rev={0,1};
    const double PI=acosl(-1.0);

    void ensure_base(int nbase)
    {
        if(nbase<=base) return;
        rev.resize(1<<nbase);
        for(int i=0;i<(1<<nbase);i++)
            rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
        roots.resize(1<<nbase);
        while(base<nbase)
        {
            double angle=2*PI/(1<<(base+1));
            for(int i=1<<(base-1);i<(1<<base);i++)
            {
                roots[i<<1]=roots[i];
                double angle_i=angle*(2*i+1-(1<<base));
                roots[(i<<1)+1]=num(cos(angle_i),sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<num> &a,int n=-1)
    {
        if(n==-1) n=a.size();
        assert((n&(n-1))==0);
        int zeros=__builtin_ctz(n);
        ensure_base(zeros);
        int shift=base-zeros;
        for(int i=0;i<n;i++)
            if(i<(rev[i]>>shift))
                swap(a[i],a[rev[i]>>shift]);
        for(int k=1;k<n;k<<=1)
        {
            for(int i=0;i<n;i+=2*k)
            {
                for(int j=0;j<k;j++)
                {
                    num z=a[i+j+k]*roots[j+k];
                    a[i+j+k]=a[i+j]-z;
                    a[i+j]=a[i+j]+z;
                }
            }
        }
    }

    vector<num> fa,fb;

    vector<int> multiply(vector<int> &a, vector<int> &b)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<sz;i++)
        {
            int x=(i<(int)a.size()?a[i]:0);
            int y=(i<(int)b.size()?b[i]:0);
            fa[i]=num(x,y);
        }
        fft(fa,sz);
        num r(0,-0.25/sz);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num z=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
            if(i!=j) fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
            fa[i]=z;
        }
        fft(fa,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++) res[i]=fa[i].x + (fa[i].x > 0 ? 0.5 : -0.5);
        return res;
    }

    vector<int> multiply_mod(vector<int> &a,vector<int> &b,int m,int eq=0)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<(int)a.size();i++)
        {
            int x=(a[i]%m+m)%m;
            fa[i]=num(x&((1<<15)-1),x>>15);
        }
        fill(fa.begin()+a.size(),fa.begin()+sz,num{0,0});
        fft(fa,sz);
        if(sz>(int)fb.size()) fb.resize(sz);
        if(eq) copy(fa.begin(),fa.begin()+sz,fb.begin());
        else
        {
            for(int i=0;i<(int)b.size();i++)
            {
                int x=(b[i]%m+m)%m;
                fb[i]=num(x&((1<<15)-1),x>>15);
            }
            fill(fb.begin()+b.size(),fb.begin()+sz,num{0,0});
            fft(fb,sz);
        }
        double ratio=0.25/sz;
        num r2(0,-1),r3(ratio,0),r4(0,-ratio),r5(0,1);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num a1=(fa[i]+conj(fa[j]));
            num a2=(fa[i]-conj(fa[j]))*r2;
            num b1=(fb[i]+conj(fb[j]))*r3;
            num b2=(fb[i]-conj(fb[j]))*r4;
            if(i!=j)
            {
                num c1=(fa[j]+conj(fa[i]));
                num c2=(fa[j]-conj(fa[i]))*r2;
                num d1=(fb[j]+conj(fb[i]))*r3;
                num d2=(fb[j]-conj(fb[i]))*r4;
                fa[i]=c1*d1+c2*d2*r5;
                fb[i]=c1*d2+c2*d1;
            }
            fa[j]=a1*b1+a2*b2*r5;
            fb[j]=a1*b2+a2*b1;
        }
        fft(fa,sz);fft(fb,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++)
        {
            ll aa=fa[i].x+0.5;
            ll bb=fb[i].x+0.5;
            ll cc=fa[i].y+0.5;
            res[i]=(aa+((bb%m)<<15)+((cc%m)<<30))%m;
        }
        return res;
    }
    vector<int> square_mod(vector<int> &a,int m)
    {
        return multiply_mod(a,a,m,1);
    }
};
vector < int > power(vector < int > v , int p)
{
    if(p == 1) return v;
    vector < int > a = power(v , p >> 1);
    a = fft::multiply(a , a);
    //for(auto &x : a)if( x > 1 ) x = 1;
    if(p&1)
    {
        a = fft::multiply(a , v);
        //for(auto &x : a)if( x > 1 ) x = 1;
    }
    return a;
}

const int N = 2e5 + 5;
const int BLOCK = 662;
const int PARTS = N/BLOCK+1;

string A , B;
vector < int > a , b[PARTS] , c[PARTS];
int n , m;

int main()
{
    ios::sync_with_stdio(false);    cin.tie(NULL);  cout.tie(NULL);

    bool swapped = false;
    cin >> A >> B;

    if(A.size() < B.size()) swap(A,B) , swapped = true;

    n = A.size();
    m = B.size();

    for(int i = 0 ; i < n ; i++)    a.push_back(A[i] == '1' ? 1 : -1);
    for(int i = 0 ; i < m ; i++)    b[i/BLOCK].push_back(B[i] == '1' ? 1 : -1);

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) reverse(b[i].begin(),b[i].end());

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) c[i] = fft::multiply(a,b[i]);

    int q;  cin >> q;
    while(q--)
    {
        int p1 , p2 , len;  cin >> p1 >> p2 >> len; if(swapped) swap(p1,p2);
        assert(len > 0);

        int ans = 0;
        for(int j = p2/BLOCK ; j <= (p2+len-1)/BLOCK ; j++)
        {
            int l = max(p2,j*BLOCK);
            int r = min(p2+len,(j+1)*BLOCK);

            if(l == j*BLOCK && r == (j+1)*BLOCK)    ans += (BLOCK - c[j][r-1+p1-p2])/2;
            else
                for(int i = l ; i < r ; i++)        ans += (A[i+p1-p2] != B[i]);
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair

using namespace std;

namespace fft
{
    struct num
    {
        double x,y;
        num() {x=y=0;}
        num(double x,double y):x(x),y(y){}
    };
    inline num operator+(num a,num b) {return num(a.x+b.x,a.y+b.y);}
    inline num operator-(num a,num b) {return num(a.x-b.x,a.y-b.y);}
    inline num operator*(num a,num b) {return num(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline num conj(num a) {return num(a.x,-a.y);}

    int base=1;
    vector<num> roots={{0,0},{1,0}};
    vector<int> rev={0,1};
    const double PI=acosl(-1.0);

    void ensure_base(int nbase)
    {
        if(nbase<=base) return;
        rev.resize(1<<nbase);
        for(int i=0;i<(1<<nbase);i++)
            rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
        roots.resize(1<<nbase);
        while(base<nbase)
        {
            double angle=2*PI/(1<<(base+1));
            for(int i=1<<(base-1);i<(1<<base);i++)
            {
                roots[i<<1]=roots[i];
                double angle_i=angle*(2*i+1-(1<<base));
                roots[(i<<1)+1]=num(cos(angle_i),sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<num> &a,int n=-1)
    {
        if(n==-1) n=a.size();
        assert((n&(n-1))==0);
        int zeros=__builtin_ctz(n);
        ensure_base(zeros);
        int shift=base-zeros;
        for(int i=0;i<n;i++)
            if(i<(rev[i]>>shift))
                swap(a[i],a[rev[i]>>shift]);
        for(int k=1;k<n;k<<=1)
        {
            for(int i=0;i<n;i+=2*k)
            {
                for(int j=0;j<k;j++)
                {
                    num z=a[i+j+k]*roots[j+k];
                    a[i+j+k]=a[i+j]-z;
                    a[i+j]=a[i+j]+z;
                }
            }
        }
    }

    vector<num> fa,fb;

    vector<int> multiply(vector<int> &a, vector<int> &b)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<sz;i++)
        {
            int x=(i<(int)a.size()?a[i]:0);
            int y=(i<(int)b.size()?b[i]:0);
            fa[i]=num(x,y);
        }
        fft(fa,sz);
        num r(0,-0.25/sz);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num z=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
            if(i!=j) fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
            fa[i]=z;
        }
        fft(fa,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++) res[i]=fa[i].x + (fa[i].x > 0 ? 0.5 : -0.5);
        return res;
    }

    vector<int> multiply_mod(vector<int> &a,vector<int> &b,int m,int eq=0)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<(int)a.size();i++)
        {
            int x=(a[i]%m+m)%m;
            fa[i]=num(x&((1<<15)-1),x>>15);
        }
        fill(fa.begin()+a.size(),fa.begin()+sz,num{0,0});
        fft(fa,sz);
        if(sz>(int)fb.size()) fb.resize(sz);
        if(eq) copy(fa.begin(),fa.begin()+sz,fb.begin());
        else
        {
            for(int i=0;i<(int)b.size();i++)
            {
                int x=(b[i]%m+m)%m;
                fb[i]=num(x&((1<<15)-1),x>>15);
            }
            fill(fb.begin()+b.size(),fb.begin()+sz,num{0,0});
            fft(fb,sz);
        }
        double ratio=0.25/sz;
        num r2(0,-1),r3(ratio,0),r4(0,-ratio),r5(0,1);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num a1=(fa[i]+conj(fa[j]));
            num a2=(fa[i]-conj(fa[j]))*r2;
            num b1=(fb[i]+conj(fb[j]))*r3;
            num b2=(fb[i]-conj(fb[j]))*r4;
            if(i!=j)
            {
                num c1=(fa[j]+conj(fa[i]));
                num c2=(fa[j]-conj(fa[i]))*r2;
                num d1=(fb[j]+conj(fb[i]))*r3;
                num d2=(fb[j]-conj(fb[i]))*r4;
                fa[i]=c1*d1+c2*d2*r5;
                fb[i]=c1*d2+c2*d1;
            }
            fa[j]=a1*b1+a2*b2*r5;
            fb[j]=a1*b2+a2*b1;
        }
        fft(fa,sz);fft(fb,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++)
        {
            ll aa=fa[i].x+0.5;
            ll bb=fb[i].x+0.5;
            ll cc=fa[i].y+0.5;
            res[i]=(aa+((bb%m)<<15)+((cc%m)<<30))%m;
        }
        return res;
    }
    vector<int> square_mod(vector<int> &a,int m)
    {
        return multiply_mod(a,a,m,1);
    }
};
vector < int > power(vector < int > v , int p)
{
    if(p == 1) return v;
    vector < int > a = power(v , p >> 1);
    a = fft::multiply(a , a);
    //for(auto &x : a)if( x > 1 ) x = 1;
    if(p&1)
    {
        a = fft::multiply(a , v);
        //for(auto &x : a)if( x > 1 ) x = 1;
    }
    return a;
}

const int N = 2e5 + 5;
const int BLOCK = 675;
const int PARTS = N/BLOCK+1;

string A , B;
vector < int > a , b[PARTS] , c[PARTS];
int n , m;

int main()
{
    ios::sync_with_stdio(false);    cin.tie(NULL);  cout.tie(NULL);

    bool swapped = false;
    cin >> A >> B;

    if(A.size() < B.size()) swap(A,B) , swapped = true;

    n = A.size();
    m = B.size();

    for(int i = 0 ; i < n ; i++)    a.push_back(A[i] == '1' ? 1 : -1);
    for(int i = 0 ; i < m ; i++)    b[i/BLOCK].push_back(B[i] == '1' ? 1 : -1);

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) reverse(b[i].begin(),b[i].end());

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) c[i] = fft::multiply(a,b[i]);

    int q;  cin >> q;
    while(q--)
    {
        int p1 , p2 , len;  cin >> p1 >> p2 >> len; if(swapped) swap(p1,p2);
        assert(len > 0);

        int ans = 0;
        for(int j = p2/BLOCK ; j <= (p2+len-1)/BLOCK ; j++)
        {
            int l = max(p2,j*BLOCK);
            int r = min(p2+len,(j+1)*BLOCK);

            if(l == j*BLOCK && r == (j+1)*BLOCK)    ans += (BLOCK - c[j][r-1+p1-p2])/2;
            else
                for(int i = l ; i < r ; i++)        ans += (A[i+p1-p2] != B[i]);
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair

using namespace std;

namespace fft
{
    struct num
    {
        double x,y;
        num() {x=y=0;}
        num(double x,double y):x(x),y(y){}
    };
    inline num operator+(num a,num b) {return num(a.x+b.x,a.y+b.y);}
    inline num operator-(num a,num b) {return num(a.x-b.x,a.y-b.y);}
    inline num operator*(num a,num b) {return num(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline num conj(num a) {return num(a.x,-a.y);}

    int base=1;
    vector<num> roots={{0,0},{1,0}};
    vector<int> rev={0,1};
    const double PI=acosl(-1.0);

    void ensure_base(int nbase)
    {
        if(nbase<=base) return;
        rev.resize(1<<nbase);
        for(int i=0;i<(1<<nbase);i++)
            rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
        roots.resize(1<<nbase);
        while(base<nbase)
        {
            double angle=2*PI/(1<<(base+1));
            for(int i=1<<(base-1);i<(1<<base);i++)
            {
                roots[i<<1]=roots[i];
                double angle_i=angle*(2*i+1-(1<<base));
                roots[(i<<1)+1]=num(cos(angle_i),sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<num> &a,int n=-1)
    {
        if(n==-1) n=a.size();
        assert((n&(n-1))==0);
        int zeros=__builtin_ctz(n);
        ensure_base(zeros);
        int shift=base-zeros;
        for(int i=0;i<n;i++)
            if(i<(rev[i]>>shift))
                swap(a[i],a[rev[i]>>shift]);
        for(int k=1;k<n;k<<=1)
        {
            for(int i=0;i<n;i+=2*k)
            {
                for(int j=0;j<k;j++)
                {
                    num z=a[i+j+k]*roots[j+k];
                    a[i+j+k]=a[i+j]-z;
                    a[i+j]=a[i+j]+z;
                }
            }
        }
    }

    vector<num> fa,fb;

    vector<int> multiply(vector<int> &a, vector<int> &b)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<sz;i++)
        {
            int x=(i<(int)a.size()?a[i]:0);
            int y=(i<(int)b.size()?b[i]:0);
            fa[i]=num(x,y);
        }
        fft(fa,sz);
        num r(0,-0.25/sz);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num z=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
            if(i!=j) fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
            fa[i]=z;
        }
        fft(fa,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++) res[i]=fa[i].x + (fa[i].x > 0 ? 0.5 : -0.5);
        return res;
    }

    vector<int> multiply_mod(vector<int> &a,vector<int> &b,int m,int eq=0)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<(int)a.size();i++)
        {
            int x=(a[i]%m+m)%m;
            fa[i]=num(x&((1<<15)-1),x>>15);
        }
        fill(fa.begin()+a.size(),fa.begin()+sz,num{0,0});
        fft(fa,sz);
        if(sz>(int)fb.size()) fb.resize(sz);
        if(eq) copy(fa.begin(),fa.begin()+sz,fb.begin());
        else
        {
            for(int i=0;i<(int)b.size();i++)
            {
                int x=(b[i]%m+m)%m;
                fb[i]=num(x&((1<<15)-1),x>>15);
            }
            fill(fb.begin()+b.size(),fb.begin()+sz,num{0,0});
            fft(fb,sz);
        }
        double ratio=0.25/sz;
        num r2(0,-1),r3(ratio,0),r4(0,-ratio),r5(0,1);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num a1=(fa[i]+conj(fa[j]));
            num a2=(fa[i]-conj(fa[j]))*r2;
            num b1=(fb[i]+conj(fb[j]))*r3;
            num b2=(fb[i]-conj(fb[j]))*r4;
            if(i!=j)
            {
                num c1=(fa[j]+conj(fa[i]));
                num c2=(fa[j]-conj(fa[i]))*r2;
                num d1=(fb[j]+conj(fb[i]))*r3;
                num d2=(fb[j]-conj(fb[i]))*r4;
                fa[i]=c1*d1+c2*d2*r5;
                fb[i]=c1*d2+c2*d1;
            }
            fa[j]=a1*b1+a2*b2*r5;
            fb[j]=a1*b2+a2*b1;
        }
        fft(fa,sz);fft(fb,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++)
        {
            ll aa=fa[i].x+0.5;
            ll bb=fb[i].x+0.5;
            ll cc=fa[i].y+0.5;
            res[i]=(aa+((bb%m)<<15)+((cc%m)<<30))%m;
        }
        return res;
    }
    vector<int> square_mod(vector<int> &a,int m)
    {
        return multiply_mod(a,a,m,1);
    }
};
vector < int > power(vector < int > v , int p)
{
    if(p == 1) return v;
    vector < int > a = power(v , p >> 1);
    a = fft::multiply(a , a);
    //for(auto &x : a)if( x > 1 ) x = 1;
    if(p&1)
    {
        a = fft::multiply(a , v);
        //for(auto &x : a)if( x > 1 ) x = 1;
    }
    return a;
}

const int N = 2e5 + 5;
const int BLOCK = 1000;
const int PARTS = N/BLOCK+1;

string A , B;
vector < int > a , b[PARTS] , c[PARTS];
int n , m;

int main()
{
    ios::sync_with_stdio(false);    cin.tie(NULL);  cout.tie(NULL);

    bool swapped = false;
    cin >> A >> B;

    if(A.size() < B.size()) swap(A,B) , swapped = true;

    n = A.size();
    m = B.size();

    for(int i = 0 ; i < n ; i++)    a.push_back(A[i] == '1' ? 1 : -1);
    for(int i = 0 ; i < m ; i++)    b[i/BLOCK].push_back(B[i] == '1' ? 1 : -1);

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) reverse(b[i].begin(),b[i].end());

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) c[i] = fft::multiply(a,b[i]);

    int q;  cin >> q;
    while(q--)
    {
        int p1 , p2 , len;  cin >> p1 >> p2 >> len; if(swapped) swap(p1,p2);
        assert(len > 0);

        int ans = 0;
        for(int j = p2/BLOCK ; j <= (p2+len-1)/BLOCK ; j++)
        {
            int l = max(p2,j*BLOCK);
            int r = min(p2+len,(j+1)*BLOCK);

            if(l == j*BLOCK && r == (j+1)*BLOCK)    ans += (BLOCK - c[j][r-1+p1-p2])/2;
            else
                for(int i = l ; i < r ; i++)        ans += (A[i+p1-p2] != B[i]);
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair

using namespace std;

namespace fft
{
    struct num
    {
        double x,y;
        num() {x=y=0;}
        num(double x,double y):x(x),y(y){}
    };
    inline num operator+(num a,num b) {return num(a.x+b.x,a.y+b.y);}
    inline num operator-(num a,num b) {return num(a.x-b.x,a.y-b.y);}
    inline num operator*(num a,num b) {return num(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
    inline num conj(num a) {return num(a.x,-a.y);}

    int base=1;
    vector<num> roots={{0,0},{1,0}};
    vector<int> rev={0,1};
    const double PI=acosl(-1.0);

    void ensure_base(int nbase)
    {
        if(nbase<=base) return;
        rev.resize(1<<nbase);
        for(int i=0;i<(1<<nbase);i++)
            rev[i]=(rev[i>>1]>>1)+((i&1)<<(nbase-1));
        roots.resize(1<<nbase);
        while(base<nbase)
        {
            double angle=2*PI/(1<<(base+1));
            for(int i=1<<(base-1);i<(1<<base);i++)
            {
                roots[i<<1]=roots[i];
                double angle_i=angle*(2*i+1-(1<<base));
                roots[(i<<1)+1]=num(cos(angle_i),sin(angle_i));
            }
            base++;
        }
    }

    void fft(vector<num> &a,int n=-1)
    {
        if(n==-1) n=a.size();
        assert((n&(n-1))==0);
        int zeros=__builtin_ctz(n);
        ensure_base(zeros);
        int shift=base-zeros;
        for(int i=0;i<n;i++)
            if(i<(rev[i]>>shift))
                swap(a[i],a[rev[i]>>shift]);
        for(int k=1;k<n;k<<=1)
        {
            for(int i=0;i<n;i+=2*k)
            {
                for(int j=0;j<k;j++)
                {
                    num z=a[i+j+k]*roots[j+k];
                    a[i+j+k]=a[i+j]-z;
                    a[i+j]=a[i+j]+z;
                }
            }
        }
    }

    vector<num> fa,fb;

    vector<int> multiply(vector<int> &a, vector<int> &b)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<sz;i++)
        {
            int x=(i<(int)a.size()?a[i]:0);
            int y=(i<(int)b.size()?b[i]:0);
            fa[i]=num(x,y);
        }
        fft(fa,sz);
        num r(0,-0.25/sz);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num z=(fa[j]*fa[j]-conj(fa[i]*fa[i]))*r;
            if(i!=j) fa[j]=(fa[i]*fa[i]-conj(fa[j]*fa[j]))*r;
            fa[i]=z;
        }
        fft(fa,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++) res[i]=fa[i].x + (fa[i].x > 0 ? 0.5 : -0.5);
        return res;
    }

    vector<int> multiply_mod(vector<int> &a,vector<int> &b,int m,int eq=0)
    {
        int need=a.size()+b.size()-1;
        int nbase=0;
        while((1<<nbase)<need) nbase++;
        ensure_base(nbase);
        int sz=1<<nbase;
        if(sz>(int)fa.size()) fa.resize(sz);
        for(int i=0;i<(int)a.size();i++)
        {
            int x=(a[i]%m+m)%m;
            fa[i]=num(x&((1<<15)-1),x>>15);
        }
        fill(fa.begin()+a.size(),fa.begin()+sz,num{0,0});
        fft(fa,sz);
        if(sz>(int)fb.size()) fb.resize(sz);
        if(eq) copy(fa.begin(),fa.begin()+sz,fb.begin());
        else
        {
            for(int i=0;i<(int)b.size();i++)
            {
                int x=(b[i]%m+m)%m;
                fb[i]=num(x&((1<<15)-1),x>>15);
            }
            fill(fb.begin()+b.size(),fb.begin()+sz,num{0,0});
            fft(fb,sz);
        }
        double ratio=0.25/sz;
        num r2(0,-1),r3(ratio,0),r4(0,-ratio),r5(0,1);
        for(int i=0;i<=(sz>>1);i++)
        {
            int j=(sz-i)&(sz-1);
            num a1=(fa[i]+conj(fa[j]));
            num a2=(fa[i]-conj(fa[j]))*r2;
            num b1=(fb[i]+conj(fb[j]))*r3;
            num b2=(fb[i]-conj(fb[j]))*r4;
            if(i!=j)
            {
                num c1=(fa[j]+conj(fa[i]));
                num c2=(fa[j]-conj(fa[i]))*r2;
                num d1=(fb[j]+conj(fb[i]))*r3;
                num d2=(fb[j]-conj(fb[i]))*r4;
                fa[i]=c1*d1+c2*d2*r5;
                fb[i]=c1*d2+c2*d1;
            }
            fa[j]=a1*b1+a2*b2*r5;
            fb[j]=a1*b2+a2*b1;
        }
        fft(fa,sz);fft(fb,sz);
        vector<int> res(need);
        for(int i=0;i<need;i++)
        {
            ll aa=fa[i].x+0.5;
            ll bb=fb[i].x+0.5;
            ll cc=fa[i].y+0.5;
            res[i]=(aa+((bb%m)<<15)+((cc%m)<<30))%m;
        }
        return res;
    }
    vector<int> square_mod(vector<int> &a,int m)
    {
        return multiply_mod(a,a,m,1);
    }
};
vector < int > power(vector < int > v , int p)
{
    if(p == 1) return v;
    vector < int > a = power(v , p >> 1);
    a = fft::multiply(a , a);
    //for(auto &x : a)if( x > 1 ) x = 1;
    if(p&1)
    {
        a = fft::multiply(a , v);
        //for(auto &x : a)if( x > 1 ) x = 1;
    }
    return a;
}

const int N = 2e5 + 5;
const int BLOCK = 700;
const int PARTS = N/BLOCK;

string A , B;
vector < int > a , b[PARTS] , c[PARTS];
int n , m;

int main()
{
    ios::sync_with_stdio(false);    cin.tie(NULL);  cout.tie(NULL);

    bool swapped = false;
    cin >> A >> B;

    if(A.size() < B.size()) swap(A,B) , swapped = true;

    n = A.size();
    m = B.size();

    for(int i = 0 ; i < n ; i++)    a.push_back(A[i] == '1' ? 1 : -1);
    for(int i = 0 ; i < m ; i++)    b[i/BLOCK].push_back(B[i] == '1' ? 1 : -1);

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) reverse(b[i].begin(),b[i].end());

    for(int i = 0 ; i <= (m-1)/BLOCK ; i++) c[i] = fft::multiply(a,b[i]);

    int q;  cin >> q;
    while(q--)
    {
        int p1 , p2 , len;  cin >> p1 >> p2 >> len; if(swapped) swap(p1,p2);
        assert(len > 0);

        int ans = 0;
        for(int j = p2/BLOCK ; j <= (p2+len-1)/BLOCK ; j++)
        {
            int l = max(p2,j*BLOCK);
            int r = min(p2+len,(j+1)*BLOCK);

            if(l == j*BLOCK && r == (j+1)*BLOCK)    ans += (BLOCK - c[j][r-1+p1-p2])/2;
            else
                for(int i = l ; i < r ; i++)        ans += (A[i+p1-p2] != B[i]);
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const unsigned N=2e5;
unsigned a[32][N+31>>5];
unsigned b[32][N+31>>5];
char s[N+1];
static int pc(unsigned n){
    int c;
    __asm__("popcnt %0, %1" : "=r"(c) : "r"(n));
    return c;
}
unsigned get(unsigned p,unsigned q,unsigned len){
	unsigned x=p>>5, y=q>>5, c=0;
	p&=31; q&=31;
	while(len>=32){
		c+=pc(a[p][x]^b[q][y]);
		++x, ++y;
		len-=32;
	}
	c+=pc((a[p][x]^b[q][y])&((1u<<len)-1));
	return c;
}
int main(){
	int n, m, q, p1, p2, len;
	scanf("%s",s); n=strlen(s);
	for(int i=0;i<32;++i){
    	for(int j=0;i+j<n;++j){
      		if(s[i+j]=='1')
				a[i][j>>5]|=(1<<(j&31));
   		}
  	}
	scanf("%s",s); m=strlen(s);
	for(int i=0;i<32;++i)
    	for(int j=0;i+j<m;++j)
      		if(s[i+j]=='1')
				b[i][j>>5]|=(1<<(j&31));

	scanf("%d",&q);
	while(q--){
		scanf("%d %d %d",&p1,&p2,&len);
		printf("%d\n",get(p1,p2,len));
	}
	return 0;
}


#pragma gcc optimize(2)
#include <bits/stdc++.h>
using namespace std;
    #define rep(i,a,b) for(int i=a;i<=b;++i)
    #define per(i,a,b) for(int i=a;i>=b;--i)
    #define rvc(i,S) for(int i=0;i<S.size();++i)
    #define mp make_pair

    #define pb push_back
    #define fi first
    #define se second
   #define ull unsigned long long
    const int maxn=200005;
   #define Div 65535
    char st[maxn];
    unsigned int a[32][maxn>>5],b[32][maxn>>5];
    int main()
    {
    	scanf("%s",st);
    	for(int j=0;j<32;j++)
    		for(int i=0;st[j+i];i++) a[j][i>>5]|=(st[j+i]=='1')*(1<<(i&31));
    	scanf("%s",st);
    	for(int j=0;j<32;j++)
    		for(int i=0;st[j+i];i++) b[j][i>>5]|=(st[j+i]=='1')*(1<<(i&31));
    	int T; cin>>T;
    	while (T--)
    	{
    		int x,y,l,ans=0,i,j;
    		scanf("%d%d%d",&x,&y,&l);
    		for(i=x>>5,j=y>>5;l>31;i++,j++,l-=32)
    			ans+=__builtin_popcount(a[x&31][i]^b[y&31][j]);
    		ans+=__builtin_popcount((a[x&31][i]^b[y&31][j])&((1<<l)-1));
    		printf("%d\n",ans);
    	}
    }


#pragma gcc optimize(2)
#include <bits/stdc++.h>
using namespace std;
    #define rep(i,a,b) for(int i=a;i<=b;++i)
    #define per(i,a,b) for(int i=a;i>=b;--i)
    #define rvc(i,S) for(int i=0;i<S.size();++i)
    #define mp make_pair

    #define pb push_back
    #define fi first
    #define se second
   #define ull unsigned long long
    const int maxn=200005;
   #define Div 65535
    char st[maxn];
    unsigned int a[32][maxn],b[32][maxn];
    int main()
    {
    	scanf("%s",st);
    	for(int j=0;j<32;j++)
    		for(int i=0;st[j+i];i++) a[j][i>>5]|=(st[j+i]=='1')*(1<<(i&31));
    	scanf("%s",st);
    	for(int j=0;j<32;j++)
    		for(int i=0;st[j+i];i++) b[j][i>>5]|=(st[j+i]=='1')*(1<<(i&31));
    	int T; cin>>T;
    	while (T--)
    	{
    		int x,y,l,ans=0,i,j;
    		scanf("%d%d%d",&x,&y,&l);
    		for(i=x>>5,j=y>>5;l>31;i++,j++,l-=32)
    			ans+=__builtin_popcount(a[x&31][i]^b[y&31][j]);
    		ans+=__builtin_popcount((a[x&31][i]^b[y&31][j])&((1<<l)-1));
    		printf("%d\n",ans);
    	}
    }


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
main()
{
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g]=firstbits[g]+(firstnext64[g+1]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g]=secondbits[g]+((secondnext64[g+1]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
int cnt [65536];
main()
{
    for (int g=0; g<(1<<16); g++) cnt[g]=__builtin_popcount(g);
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g]=firstbits[g]+(firstnext64[g+1]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g]=secondbits[g]+((secondnext64[g+1]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                int t=firstnext64[l+y]^secondnext64[r+y];
                answer+=cnt[t&0xFFFF]+cnt[(t>>16)&0xFFFF]+cnt[(t>>32)&0xFFFF]+cnt[(t>>48)&0xFFFF];
            }
        }
        printf("%d\n", answer);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define PII pair <int, int>
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
int main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=0; g<a.length(); g++)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1<<63))<<1);
    }
    for (int g=0; g<b.length(); g++)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1<<63))<<1);
    }
    int Q; cin >> Q;
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1<<63))<<1);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1<<63))<<1);
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=0; g<a.length(); g++)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1<<63))<<1);
    }
    for (int g=0; g<b.length(); g++)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1<<63))<<1);
    }
    int Q; cin >> Q;
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        cin >> l >> r >> leng;
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1ULL<<63))*2ULL);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1ULL<<63))*2ULL);
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+(firstnext64[g+1]<<1);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [64][3150];
unsigned long long secondnext64 [64][3150];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
int cnt [65536];
main()
{
    for (int g=0; g<(1<<16); g++) cnt[g]=__builtin_popcount(g);
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g&63][g>>6]=firstbits[g]+(firstnext64[(g+1)&63][(g+1)>>6]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g&63][g>>6]=secondbits[g]+((secondnext64[(g+1)&63][(g+1)>>6]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                ULL t=firstnext64[(l+y)&63][(l+y)>>6]^secondnext64[(r+y)&63][(r+y)>>6];
                answer+=cnt[t&0xFFFF]+cnt[(t>>16)&0xFFFF]+cnt[(t>>32)&0xFFFF]+cnt[(t>>48)&0xFFFF];
            }
        }
        printf("%d\n", answer);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1ULL<<63))*2ULL);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1ULL<<63))*2ULL);
    }
    int Q; cin >> Q;
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        cin >> l >> r >> leng;
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [64][3150];
unsigned long long secondnext64 [64][3150];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
int cnt [65536];
main()
{
    for (int g=0; g<(1<<16); g++) cnt[g]=__builtin_popcount(g);
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g&63][g>>6]=firstbits[g]+(firstnext64[(g+1)&63][g>>6]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g&63][g>>6]=secondbits[g]+((secondnext64[(g+1)&63][g>>6]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                ULL t=firstnext64[(l+y)&63][(l+y)>>6]^secondnext64[(r+y)&63][(r+y)>>6];
                answer+=cnt[t&0xFFFF]+cnt[(t>>16)&0xFFFF]+cnt[(t>>32)&0xFFFF]+cnt[(t>>48)&0xFFFF];
            }
        }
        printf("%d\n", answer);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1ULL<<63))*2ULL);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1ULL<<63))*2ULL);
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=1)
        {
                    if (firstbits[l+y]!=secondbits[r+y])
                    {
                        answer++;
                    }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=firstbits[g]+(firstnext64[g+1]<<1);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=secondbits[g]+((secondnext64[g+1]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1ULL<<63))*2ULL);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1ULL<<63))*2ULL);
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                answer+=__builtin_popcountll(firstnext64[l+y]^secondnext64[r+y]);
            }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
int cnt [65536];
main()
{
    for (int g=0; g<(1<<16); g++) cnt[g]=__builtin_popcount(g);
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g]=firstbits[g]+(firstnext64[g+1]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g]=secondbits[g]+((secondnext64[g+1]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
            if (leng-y<64)
            {
                for (int z=y; z<=leng-1; z++)
                {
                    if (firstbits[l+z]!=secondbits[r+z]) answer++;
                }
            }
            else
            {
                ULL t=firstnext64[l+y]^secondnext64[r+y];
                answer+=cnt[t&0xFFFF]+cnt[(t>>16)&0xFFFF]+cnt[(t>>32)&0xFFFF]+cnt[(t>>48)&0xFFFF];
            }
        }
        printf("%d\n", answer);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [64][3150];
unsigned long long secondnext64 [64][3150];
char a [200005];
char b [200005];
int firstbits [200105];
int secondbits [200105];
int cnt [65536];
main()
{
    for (int g=0; g<(1<<16); g++) cnt[g]=__builtin_popcount(g);
    scanf("%s", a);scanf("%s", b);
    int lengA=strlen(a), lengB=strlen(b);
    for (int g=0;g<lengA;g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<lengB;g++)secondbits[g]=b[g]-'0';
    for (int g=lengA-1; g>=0; g--)
    {
        firstnext64[g&63][g>>6]=firstbits[g]+(firstnext64[(g+1)&63][(g+1)>>6]<<1);
    }
    for (int g=lengB-1; g>=0; g--)
    {
        secondnext64[g&63][g>>6]=secondbits[g]+((secondnext64[(g+1)&63][(g+1)>>6]<<1));
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        int m=l&63, mm=r&63;
        int loop=leng>>6;
        for (int z=0; z<loop; z++)
        {
            int y=64*z;
            ULL t=firstnext64[m][(l+y)>>6]^secondnext64[mm][(r+y)>>6];
            answer+=cnt[t&0xFFFF]+cnt[(t>>16)&0xFFFF]+cnt[(t>>32)&0xFFFF]+cnt[(t>>48)];
        }
        for (int z=leng-(leng&63); z<leng; z++)
        {
            answer+=firstbits[l+z]^secondbits[r+z];
        }
        printf("%d\n", answer);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
unsigned long long firstnext64 [200105];
unsigned long long secondnext64 [200105];
int firstbits [200105];
int secondbits [200105];
main()
{
    string a,b;cin>>a>>b;
    for (int g=0;g<a.length();g++)firstbits[g]=a[g]-'0';
    for (int g=0;g<b.length();g++)secondbits[g]=b[g]-'0';
    for (int g=a.length()-1; g>=0; g--)
    {
        firstnext64[g]=a[g]+((firstnext64[g+1]-firstbits[g+64]*(1ULL<<63))*2ULL);
    }
    for (int g=b.length()-1; g>=0; g--)
    {
        secondnext64[g]=b[g]+((secondnext64[g+1]-secondbits[g+64]*(1ULL<<63))*2ULL);
    }
    int Q; scanf("%d", &Q);
    for (int g=0; g<Q; g++)
    {
        int l, r, leng;
        scanf("%d %d %d", &l, &r, &leng);
        int answer=0;
        for (int y=0; y<leng; y+=64)
        {
                    if (firstbits[l+y]!=secondbits[r+y])
                    {
                        answer++;
                    }
        }
        cout << answer << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 200005;

int an, bn, q;
char sa[N], sb[N];
unsigned a[32][N], b[32][N];
int bits[1 << 16];
int count_bits(unsigned x) {
	return bits[x & ((1u << 16) - 1)] + bits[x >> 16];
}

int main() {
	for (int i = 0; i < (1 << 16); ++i)
		bits[i] = bits[i >> 1] + (i & 1);
	scanf("%s%s", sa, sb);
	an = strlen(sa);
	bn = strlen(sb);
	for (int j = 0; j < 32; ++j) {
		for (int i = 0; i + j < an; ++i) {
			if (sa[i + j] == '1') {
				a[j][i >> 5] |= (1u << (i & 31));
			}
		}
	}
	for (int j = 0; j < 32; ++j) {
		for (int i = 0; i + j < bn; ++i) {
			if (sb[i + j] == '1') {
				b[j][i >> 5] |= (1u << (i & 31));
			}
		}
	}
	scanf("%d", &q);
	while (q--) {
		int p1, p2, len;
		scanf("%d%d%d", &p1, &p2, &len);
		unsigned *a = ::a[p1 & 31];
		unsigned *b = ::b[p2 & 31];
		int ai = p1 >> 5;
		int bi = p2 >> 5;
		int ham = 0;
		int L = (len >> 5);
		for (int i = 0; i < L; ++i) {
			ham += count_bits(a[ai + i] ^ b[bi + i]);
		}
		if (len & 31) {
			ham += count_bits((a[ai + L] ^ b[bi + L]) & ((1u << (len & 31)) - 1));
		}
		printf("%d\n", ham);
	}
}


#include <bits/stdc++.h>
using namespace std;
const int N = 200005;

int q;
char a[N], b[N];
long long bit[1<<16], mask=(1<<16)-1;
inline long long count_bits(long long x) {return bit[x&mask] + bit[x>>16];}

long long ha[32][N>>5], hb[32][N>>5];

int main() {
	for (int i = 1; i < 1<<16; ++i)
		bit[i] = bit[i>>1] + (i&1);
	scanf("%s%s", a, b);
	int an = strlen(a);
	int bn = strlen(b);
	for (int j = 0; j < 32; ++j) {
		for (int i = 0; i+j < an; ++i)
			if (a[i+j] == '1')
				ha[j][i>>5] |= (1 << (i&31));
		for (int i = 0; i+j < bn; ++i)
			if (b[i+j] == '1')
				hb[j][i>>5] |= (1 << (i&31));
	}
	// cout << ha[0][0] << endl;
	scanf("%d", &q);
	while (q--) {
		int x, y, len;
		scanf("%d%d%d", &x, &y, &len);
		int ai = x >> 5, aj = x & 31;
		int bi = y >> 5, bj = y & 31;
		int blocks = len >> 5;
		int leftover = len & 31;
		int ham = 0;
		for (int i = 0; i < blocks; ++i) {
			ham += count_bits(ha[aj][ai+i] ^ hb[bj][bi+i]);
		}
		if (leftover) {
			int mask = (1 << leftover) - 1;
			ham += count_bits((ha[aj][ai + blocks] ^ hb[bj][bi + blocks]) & mask);
		}
		printf("%d\n", ham);
	}
}


#include <stdio.h>
int main()
{
    int a,i,s[9000005],sum=0,sum1=0,count=0;
    scanf("%d",&a);
    for(i=0;i<a;i++)
    {
        scanf("%d",&s[i]);
        sum=sum+s[i];
    }
     for(i=0;i<a;i++)
    {
        sum1=sum1+s[i];
        count++;
        if(sum1>=(sum/2))
        {
            break;
        }
    }
    printf("%d",count);
}


#include <stdio.h>
int main()
{
    int a,i,s[100005],sum=0,sum1=0,count=0;
    scanf("%d",&a);
    for(i=0;i<a;i++)
    {
        scanf("%d",&s[i]);
        sum=sum+s[i];
    }
     for(i=0;i<a;i++)
    {
        sum1=sum1+s[i];
        count++;
        if(sum1>=(sum/2))
        {
            break;
        }
    }
    printf("%d",count);
}


#include <stdio.h>
int main()
{
    int a,i,s[200005],sum=0,sum1=0,count=0;
    scanf("%d",&a);
    for(i=0;i<a;i++)
    {
        scanf("%d",&s[i]);
        sum=sum+s[i];
    }
    if(sum%2==1)
    {
        sum++;
    }
     for(i=0;i<a;i++)
    {
        sum1=sum1+s[i];
        count++;
        if(sum1>=(sum/2))
        {
            break;
        }
    }
    printf("%d",count);
}


#include <stdio.h>
int main()
{
	long long int num,i,j,sum=0,count=0,sum1=0,s[1000005];
	scanf("%lld",&num);
	for(i=0;i<num;i++)
	{
		scanf("%lld",&s[i]);
		sum=sum+s[i];
	}
	for(i=0;i<num;i++)
	{
		sum1=sum1+s[i];
		count++;
		if(sum1>=(1.0)*(sum)/2)
		{
			break;
		}
	}
	printf("%lld",count);
}


#include<stdio.h>
int ara[10000000];
int main()
{
    int i,a,sum1=0;
    double sum=0;
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&ara[i]);
        sum+=ara[i];
    }
    for(i=0;i<a;i++){
            sum1+=ara[i];
        if((sum/2)<=sum1){
            printf("%d\n",i+1);
            return 0;
        }
    }
    return 0;
}


#include<stdio.h>
int main ()
{
    int n,i,x=0,b=0;
    int count
    ;

    scanf("%d",&n);
    int a[n];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        b=b+a[i];
    }
    for(i=0; i<n; i++)
    {
        x=x+a[i];

        if(b%2==0)
        {
            if(x>=b/2)
            {

                count=i+1;
                break;
            }
        }

        if (b%2!=0)
        {

            if(x>=b/2+1)
            {

                count=i+1;
                break;
            }
        }

    }

    printf("%d",count);

}


#include<stdio.h>
int main ()
{

    int n,i,m=0,j=0;
    scanf("%d",&n);
    int a[n];
    for(i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
        m=m+a[i];

    }
    int count=0;
    for(i=0; i<n; i++)
    {
        j=j+a[i];
        count++;
        if((j==m/2)||(j==(m/2)+1))
        {
            printf("%d",count);
            break;
        }

    }

}


#include<stdio.h>
int main()
{
    int long i,n,a[200000]={0},sum=0,sum1=0;
    scanf("%ld",&n);
    for(i=1;i<=n;i++)
    {
        scanf("%ld",&a[i]);
        sum+=a[i];
    }
    i=0;
    while(sum1<sum/2.0)
    {
        i++;
        sum1+=a[i];
    }
    printf("%ld",i);
    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,arr[200000],count=0;
    double sum=0,sum2=0;
    scanf("%d",&t);

    for(i=0;i<t;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];
    }

    int total = ceil(sum/2);
    //printf("%d",total);

    for(i=0;i<t;i++)
    {
        sum2+=arr[i];
        count++;

        if(sum2>=(total))
        {
            printf("%d",count);
            return 0;
        }
    }

    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,arr[3000005],count=0;
    float sum=0,sum2=0;
    scanf("%d",&t);

    for(i=0;i<t;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];
    }

    for(i=0;i<t;i++)
    {
        sum2+=arr[i];
        count++;

        if(sum2>=(sum/2))
        {
            printf("%d",count);
            return 0;
        }
    }

    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,arr[3000005],count=0;
    float sum=0,sum2=0;
    scanf("%d",&t);

    for(i=0;i<t;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];
    }

    for(i=0;i<t;i++)
    {
        sum2+=arr[i];
        count++;

        if(sum2>(sum/2))
        {
            printf("%d",count);
            return 0;
        }
    }

    return 0;
}


#include<stdio.h>

int main()
{
    int i,t,arr[1000],count=0;
    float sum=0,sum2=0;
    scanf("%d",&t);

    for(i=0;i<t;i++)
    {
        scanf("%d",&arr[i]);
        sum+=arr[i];
    }

    for(i=0;i<t;i++)
    {
        sum2+=arr[i];
        count++;

        if(sum2>=(sum/2))
        {
            printf("%d",count);
            return 0;
        }
    }

    return 0;
}


#include<stdio.h>
#include<stdlib.h>
int main()
{
    long n,i;
    long long s1=0,s2=0;
    scanf("%ld",&n);
    int *a=malloc(n*sizeof(int));
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    s1+=a[i];}
    for(i=0;i<n;i++)
    {
        s2+=a[i];
        if(s2>=(s1+1)/2)
        {
            printf("%ld",i+1);
            return 0;
        }
    }

}


#include<stdio.h>
#define N 10000
main()
{
    int T[10000];
    int n,sum,i,j ;
    float aux;
    scanf("%d",&n);
    sum=0;
    for (i=0;i<n;i++)
    {
        scanf("%d",&T[i]);
        sum+=T[i];
    }
    aux=0;
    for (j=0;j<n;j++)
    {
        aux+=T[j];
        if ( aux>=sum/2){break;}
    }
    printf("%d",j+1);
}


#include<stdio.h>
main()
{
    int T[10000];
    int n,sum,i,j,aux;
    scanf("%d",&n);
    sum=0;
    for (i=0;i<n;i++)
    {
        scanf("%d",&T[i]);
        sum+=T[i];
    }
    aux=0;
    for (j=0;j<n;j++)
    {
        aux+=T[j];
        if ( aux*2>=sum){break;}
    }
    printf("%d",j+1);
}


#include<stdio.h>
main()
{
    int T[200000];
    int n,sum,i,j,aux;
    scanf("%d",&n);
    sum=0;
    for (i=0;i<n;i++)
    {
        scanf("%d",&T[i]);
        sum=sum+T[i];
    }
    aux=0;
    for (j=0;j<n;j++)
    {
        if ((aux*2)<sum)
        {
            aux=aux+T[j];
        }
        else
        {
            break;
        }
    }
    printf("%d",j+1);
}


#include<stdio.h>
main()
{
    int T[50];
    int n,sum,i,j ;
    float aux;
    scanf("%d",&n);

    sum=0;
    for (i=0;i<n;i++)
    {
        scanf("%d",&T[i]);
        sum+=T[i];
    }
    aux=0;
    for (j=0;j<n;j++)
    {
        aux+=T[j];
        if (aux>=sum/2)
        {
            break;
        }
    }
    printf("%d",j+1);
}


#include<stdio.h>
int main()
{
	int n, i, s = 0, c = 0;
	scanf("%d", &n);
	int a[2000001];
	for (i = 0; i<n; i++)
	{
		scanf("%d", &a[i]);
		s = s + a[i];
	}
	for (i = 0; i<n; i++)
	{
		if (c * 2 < s)
		{
			c = c + a[i];
		}
		else
		{
			break;
		}
	}
	printf("%d\n", i);
	return 0;
}


#include <stdio.h>

int pro[200010];
int n;
int sum = 0;
int k = 0;
int i;
int day;

int main() {
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &pro[i]);
		sum += pro[i];
	}
	for (i = 0; i < n; i++) {
		k += pro[i];
		if (2 * k >= sum) {
			day = i + 1;
			break;
		}
	}
	printf("%d", day);
	return 0;
}


#include<stdio.h>
int main()
{
    int n,i,sum=0,p,num=0;
    scanf("%d",&n);
    int a[n];
    for(i=0;i<n;i=i+1)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    if(sum%2==0)
    {
        p=sum/2;
    }
    else
    {
        p=(sum/2)+1;
    }
    for(i=0;i<n;i=i+1)
    {
        num=num+a[i];
        if(num>=p)
        {
            printf("%d\n",i+1);
            break;
        }
    }
}


#include<stdio.h>
int main()
{
    int n,i,j,r,c=0,sum=0;
    scanf("%d",&n);
    int ar[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ar[i]);
        sum+=ar[i];
    }
    for(i=0;i<n;i++)
    {
        c+=ar[i];
        if(c>=sum/2)
        {
            printf("%d",i+1);
            break;
        }
    }
}


#include<stdio.h>
int main()
{
    int n,i,j,r,c=0,sum=0;
    scanf("%d",&n);
    int ar[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&ar[i]);
        sum+=ar[i];
    }
    for(i=0;i<n;i++)
    {
        c+=ar[i];
        if(c>=sum/2 +(sum%2))
        {
            printf("%d",i+1);
            break;
        }
    }
}


#include<stdio.h>
int main()
{
    int n,i;
    scanf("%d",&n);
    float arr[n],sum=0,sum1=0;

    for(i=0;i<n;i++)
    {
        scanf("%f",&arr[i]);
        sum=sum+arr[i];
    }
    for(i=0;i<n;i++)
    {
        sum1=sum1+arr[i];
        if(sum1>=sum/2)
        {
            printf("%d",i+1);
            break;
        }
    }
}


#include<stdio.h>
int main()
{
    int n,i;
    scanf("%d",&n);
    float arr[n],sum=0,sum1=0;
    for(i=0;i<n;i++)
    {
        scanf("%f",&arr[i]);
        sum=sum+arr[i];
    }
    for(i=0;i<n;i++)
    {
        sum1=sum1+arr[i];
        if(sum1>=sum/2)
        {
            printf("%d",i+1);
            break;
        }
    }
}


    #include <stdio.h>

    #define N 200000

    int main() {
    	static int aa[N];
    	int n, i, sum1, sum2;

    	scanf("%d", &n);
    	sum1 = 0;
    	for (i = 0; i < n; i++) {
    		scanf("%d", &aa[i]);
    		sum1 += aa[i];
    	}
    	sum2 = 0;
    	for (i = 0; i < n; i++) {
    		sum2 += aa[i];
    		if (sum2 >= (sum1 + 1) / 2)
    			break;
    	}
    	printf("%d\n", i + 1);
    	return 0;
    }


#include<stdio.h>

int main()
{
    int n,p[2000000],a=0,i,r,count=0;
    float sum=0, sm=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    scanf("%d",&p[i]);
    a=a+p[i];}
    sm=a/2;
    for(i=0;i<n;i++)
    {
      sum=sum+p[i];

     if(sum>=sm)
     {

           count++;
    }}
    printf("%d",count);
    return 0;

}


#include<stdio.h>

int main()
{
    int n,p[2000000],i,r,count=0;
    double sum=0, a=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    scanf("%d",&p[i]);
    a=a+p[i];

    }
    a=a/2;
    for(i=0;i<n;i++)
    {
     if(sum<=a)
     {
       sum=sum+p[i];
           count++;
     }
    }
    printf("%d",count);
    return 0;

}


#include<stdio.h>

int main()
{
    int n,p[2000000],i,r,count=0;
    double sum=0, a=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    scanf("%d",&p[i]);
    a=a+p[i];

    }
    a=a/2;
    for(i=0;i<n;i++)
    {
     if(sum<a)
     {
       sum=sum+p[i];
           count++;
     }else break;
    }
    printf("%d",count);
    return 0;

}


#include <stdio.h>

int main(void) {
	// your code goes here
	long n,sum=0,i,c=0;
	scanf("%ld", &n);
	long a[n];
	for(i=0;i<n;i++)
	{
		scanf("%ld", &a[i]);
		sum+=a[i];
	}
	for(i=0;i<n;i++)
	{
		c+=a[i];
		if(c>=(sum+1)/2)
		break;
	}
	printf("%ld", i+1);

	return 0;
}


#include <stdio.h>

int main(void) {
	// your code goes here
	long n,sum=0,i,c=0;
	scanf("%ld", &n);
	long a[n];
	for(i=0;i<n;i++)
	{
		scanf("%ld", &a[i]);
		sum+=a[i];
	}
	for(i=0;i<n;i++)
	{
		c+=a[i];
		if(c>=sum/2)
		break;
	}
	printf("%ld", i+1);

	return 0;
}


#include <stdio.h>

int main(void) {
	// your code goes here
	long n,sum=0,i,c=0;
	scanf("%ld", &n);
	long a[n];
	for(i=0;i<n;i++)
	{
		scanf("%ld", &a[i]);
		sum+=a[i];
	}
	for(i=0;i<n;i++)
	{
		c+=a[i];
		if(c>=sum+1/2)
		break;
	}
	printf("%ld", i+1);

	return 0;
}


#include <stdio.h>

int main(void){
	int n;
	int lala[200002] = {0};
	scanf("%d", &n);
	int counter = 0;
	for(int i = 0; i < n; i ++){
		scanf("%d", &(lala[i]));
		counter += lala[i];
	}
	int temp = counter;
	for(int i = 0; i < n; i ++){
		temp -= lala[i];
		if(counter % 2 == 0){
			if(temp <= (counter/2)){
				printf("%d\n", i+1);
				break;
			}
		}
		else{
			if(temp <= (counter/2 + 1)){
				printf("%d\n", i+1);
				break;
			}
		}
	}
	return 0;
}


#include <stdio.h>

int main(void){
	int n;
	int lala[200002] = {0};
	scanf("%d", &n);
	int counter = 0;
	for(int i = 0; i < n; i ++){
		scanf("%d", &(lala[i]));
		counter += lala[i];
	}
	int temp = 0;
	for(int i = 0; i < n; i ++){
		temp += lala[i];
		if(counter % 2 == 0){
			if(temp >= (counter/2)){
				printf("%d\n", i+1);
				break;
			}
		}
		else{
			if(temp >= (counter/2 + 1)){
				printf("%d\n", i+1);
				break;
			}
		}
	}
	return 0;
}


#include<stdio.h>

int main()
{
    long long int a[100000],i,t,num=0;
    double sum=0;
    scanf("%lld",&t);
    for(i=0;i<t;i++)
    {
        scanf("%lld",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    long int a[500000],i,t,num=0;
    float sum=0;
    scanf("%ld",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    long long int a[100000],i,t,num=0;
    float sum=0;
    scanf("%lld",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    int a[500000],i,t,num=0;
    float sum=0;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    long long int i,t,num=0;
    double sum=0;
    scanf("%lld",&t);
    long long int a[t];
    for(i=0;i<t;i++)
    {
        scanf("%lld",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    long long int a[100000],i,t,num=0;
    float sum=0;
    scanf("%ld",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    int a[500000],i,t,sum=0,num=0;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    int a[50],i,t,sum=0,num=0;
    scanf("%d",&t);
    for(i=0;i<t;i++)
    {
        scanf("%d",&a[i]);
        sum=sum+a[i];
    }
    sum=sum/2;
    for(i=0;i<t;i++)
    {
        num=num+a[i];
        if(num>=sum)
            break;
    }
    printf("%d",i+1);
}


#include <stdio.h>

int main() {
    int n;

    scanf("%d",&n);
    int a[n];
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    int sum1=a[0],sum2=a[n-1],i=0,j=n-1;
    while(i!=j){
        if(sum1 >= sum2){
            j--;
            sum2 += a[j];
        }
        else{
            i++;
            sum1 += a[i];
        }
    }
    printf("%d",i+1);
    return 0;
}


#include <stdio.h>

#define DATA_SIZE 200005
int data[DATA_SIZE];

int main(){
    int n, sum = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; ++n){
        scanf("%d", data + i);
        sum += data[i];
    }
    int half = sum % 2 ? (sum >> 1) + 1 : (sum >> 1);
    sum = 0;
    for(int i = 0; i < n; i++){
        sum += data[i];
        if(sum >= half){
            printf("%d", i + 1);
            break;
        }
    }
    return 0;
}


#include <stdio.h>
#include <memory.h>

#define DATA_SIZE 200005
int data[DATA_SIZE];

int main()
{
	int n, sum = 0;
	memset(data, 0, sizeof(data));
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d", data + i);
		sum += data[i];
	}
	int half = sum % 2 ? (sum >> 1) + 1 : (sum >> 1);
	sum = 0;
	for (int i = 0; i < n; i++)
	{
		sum += data[i];
		if (sum >= half)
		{
			printf("%d", i + 1);
			break;
		}
	}
	return 0;
}


#include<stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int a[n], i, sum=0, sum1=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
		sum+=a[i];
	}
	for(i=0;i<n;i++)
	{
		sum1+=a[i];
		if(sum1>=(0.5*sum))
			break;
	}
	printf("%d",i+1);
}


#include<stdio.h>

int main()
{
    long long n;
    scanf("%lld",&n);
    long long ar[n],sum=0,temp=0,p=0;
    for(long long i=0;i<n;i++)
    {
    scanf("%lld",&ar[i]);
    sum+=ar[i];
    }
    if(sum%2!=0)
    sum+=1;
    for(long long i=0;i<n;i++)
    {
    temp+=ar[i];
    if(temp>=sum/2)
    {
    p=i;
    break;
    }
    }
    long long y=p+1;
    printf("%lld",y);
    return 0;
}


#include <stdio.h>

int main(){
	long n;
	scanf("%ld",&n);
	double probsolvedfromday1[n];
	for(int i=0;i<n;i++){
		double solved;
		scanf("%lf",&solved);
		if(i>0){
			probsolvedfromday1[i]=probsolvedfromday1[i-1]+solved;
		}
		else{
			probsolvedfromday1[i]=solved;
		}
	}
	double totalsolved=probsolvedfromday1[n-1];
	int idx=0;
	while(probsolvedfromday1[idx]<totalsolved/2){
		idx++;
	}
	printf("%d\n",idx+1);
}


#include <stdio.h>

int main(){
	long n;
	scanf("%d",&n);
	long probsolvedfromday1[n];
	for(int i=0;i<n;i++){
		int solved;
		scanf("%d",&solved);
		if(i>0){
			probsolvedfromday1[i]=probsolvedfromday1[i-1]+solved;
		}
		else{
			probsolvedfromday1[i]=solved;
		}
	}
	long totalsolved=probsolvedfromday1[n-1];
	int idx=0;
	while(probsolvedfromday1[idx]<totalsolved/2){
		idx++;
	}
	printf("%d\n",idx+1);
}


#include <stdio.h>

int main(){
	int n;
	scanf("%d",&n);
	int probsolvedfromday1[n];
	for(int i=0;i<n;i++){
		int solved;
		scanf("%d",&solved);
		if(i>0){
			probsolvedfromday1[i]=probsolvedfromday1[i-1]+solved;
		}
		else{
			probsolvedfromday1[i]=solved;
		}
	}
	int totalsolved=probsolvedfromday1[n-1];
	int idx=0;
	while(probsolvedfromday1[idx]<totalsolved/2){
		idx++;
	}
	printf("%d\n",idx+1);
}


#include <stdio.h>
int main()
{
	int num,i,j,sum=0,count=0,sum1=0,s[100005];
	scanf("%d",&num);
	for(i=0;i<num;i++)
	{
		scanf("%d",&s[i]);
		sum=sum+s[i];
	}
	for(i=0;i<num;i++)
	{
		sum1=sum1+s[i];
		count++;
		if(sum1>=(sum)/2)
		{
			break;
		}
	}
	printf("%d",count);
}


#include <stdio.h>
int main()
{
	long long int num,i,j,sum=0,count=0,sum1=0,s[1000005];
	scanf("%lld",&num);
	for(i=0;i<num;i++)
	{
		scanf("%lld",&s[i]);
		sum=sum+s[i];
	}
	for(i=0;i<num;i++)
	{
		sum1=sum1+s[i];
		count++;
		if(sum1>=(1.0)*(sum)/2)
		{
			break;
		}
	}
	printf("%lld",count);
}


#include <stdio.h>
int main()
{
	long long int num,i,j,sum=0,count=0,sum1=0,s[1000005];
	scanf("%lld",&num);
	for(i=0;i<num;i++)
	{
		scanf("%lld",&s[i]);
		sum=sum+s[i];
	}
	for(i=0;i<num;i++)
	{
		sum1=sum1+s[i];
		count++;
		if(sum1>=(sum)/2)
		{
			break;
		}
	}
	printf("%lld",count);
}


#include<stdio.h>
#include<stdlib.h>
void fun(int [],int );
void fun(int a[],int n)
{
    int i,sum=0,ans=0;
    for(i=0;i<n;i++)
    {
        sum=sum+a[i];
    }
    for(i=0;i<n;i++)
    {
        ans=ans+a[i];
        if(sum%2==0)
        {
            if(ans>=sum/2)
            {
                printf("%d\n",i+1);
                return;
            }
        }
        else
        {
            if(ans>=sum/2+1)
            {
                printf("%d\n",i+1);
                return;
            }
        }
    }
}
int main()
{
    int a[200001];
    int n,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    fun(a,n);
    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int i,cases;
    scanf("%d",&cases);
    int ara[cases];
    int sum = 0;
    int sum2 = 0;
    for (i = 0; i < cases; i++)
    {
        scanf("%d", &ara[i]);
        sum += ara[i];
    }
    sum = ceil(sum * 0.5);
    for (i = 0; sum2 < sum; i++)
    {
        sum2 += ara[i];
    }
    printf("%d\n", i);
    return 0;
}


#include<stdio.h>

int main()
{
    int i,n,sum = 0;
    scanf("%d",&n);

int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum = sum + a[i];
    }

    if(sum%2 != 0)
    sum++;

   n = (sum/2);
   i = 0;
   sum = 0;
    while(sum<n)
    {
        sum = sum + a[i];
        i++;
    }

    printf("%d",i);

    return 0;
}


#include<stdio.h>

int main()
{
    int i,n,sum = 0;
    scanf("%d",&n);

int a[n];
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        sum = sum + a[i];
    }

   n = (sum/2);
   i = 0;
   sum = 0;
    while(sum<n)
    {
        sum = sum + a[i];
        i++;
    }

    printf("%d",i);

    return 0;
}


#include<stdio.h>

int main()
{
	int n;
	scanf("%d",&n);

	int i,ara[n];
	for(i=0;i<n;i++) {
        scanf("%d",&ara[i]);
	}
	int sum=0;
	for(i=0;i<n;i++) {
        sum+=ara[i];
	}
	int count=0;
	int count1=0;
	if(n==1) {
        printf("%d",1);
	}
	else if(sum%2==0) {
        for(i=0;i<n;i++) {
            count+=ara[i];
            if(count>=sum/2) {
                printf("%d",i+1);
                break;
            }
        }
	}
	else {
        for(i=0;i<n;i++) {
            count1+=ara[i];
            if(count1>sum/2) {
                printf("%d",i+1);
                break;
            }
        }
	}
    return 0;
}


#include <stdio.h>
int main()
{
    long long int  n;
    while(scanf("%lld",&n)!=EOF)
    {
        long long int i,a[200005],t=0,sum=0;
         for(i=0;i<n;i++)
            {scanf("%lld",&a[i]);
              sum=sum+a[i];
            }
        for(i=0;i<n;i++)
        {
            t=t+a[i];
           if(sum%2==0)
           {
               if(t>=sum/2)
                break;
           }
           if(sum%2==1)
           {
               if(t>=(sum/2+1))
                break;
           }
        }
        printf("%lld\n",i+1);

    }
    return 0;
}


using System;
 class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.In.ReadToEnd().Split(new char[] { '\t', ' ', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
            int[] dt = new int[input.Length];
            for (int i = 1; i < input.Length; ++i)
              dt[i] += dt[i - 1] + int.Parse(input[i]);
            dt[0] = (dt[dt.Length-1] / 2 + dt[dt.Length-1] % 2);
            {
                int l = 0, r = dt.Length-1, m;
                while(r-l>1)
                {
                    m = (r + l) / 2;
                    if (dt[m] < dt[0]) l = m;
                    else r = m;
                }
                Console.WriteLine(r);
            }
        }
    }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string s1 = Console.ReadLine();
            //считывание n и m
            int n = 0;
            for (int i = 0; i < s.Length; i++)
            {
                n = n * 10 + Convert.ToInt32(s[i].ToString());
            }

            //int sum_b = 0, sum_a = 0;

            //считвание массивов
            int ekv = 0;
            if (n >0)
            {
                int[] a = new int[n];
                int[] a_sum = new int[n];
                int nom = 0;
                //int[] max_a_index = new int[n];
                //max_a_index[0] = -1;
                //int max_a_l = 0, max_a = -1;
                int sum = 0;
                for (int i = 0; i < s1.Length; i++)
                {
                    if (s1[i] == ' ')
                    {
                        if (nom != 0) a_sum[nom] = a_sum[nom - 1] + a[nom];
                        else a_sum[nom] = a[nom];
                        nom++; continue;
                    }
                    a[nom] = a[nom] * 10 + Convert.ToInt32(s1[i].ToString());
                }
                if (n > 1) a_sum[n - 1] = a_sum[n - 2] + a[n - 1];
                else a_sum[0] = a[n-1];
                //sum = a_sum[n];
                for (int i = 0; i < n; i++)
                {
                    if (a_sum[i]>= a_sum[n-1] / 2)
                    {
                        ekv = i + 1;
                        break;
                    }
                }
            }

            //вывод решения
            Console.WriteLine(ekv.ToString());
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string s1 = Console.ReadLine();
            //считывание n и m
            int n = 0;
            for (int i = 0; i < s.Length; i++)
            {
                n = n * 10 + Convert.ToInt32(s[i].ToString());
            }

            //int sum_b = 0, sum_a = 0;

            //считвание массивов
            int ekv = 0;
            if (n >0)
            {
                int[] a = new int[n];
                int[] a_sum = new int[n];
                int nom = 0;
                //int[] max_a_index = new int[n];
                //max_a_index[0] = -1;
                //int max_a_l = 0, max_a = -1;
                int sum = 0;
                for (int i = 0; i < s1.Length; i++)
                {
                    if (s1[i] == ' ')
                    {
                        if (nom != 0) a_sum[nom] = a_sum[nom - 1] + a[nom];
                        else a_sum[nom] = a[nom];
                        nom++; continue;
                    }
                    a[nom] = a[nom] * 10 + Convert.ToInt32(s1[i].ToString());
                }
                if (n > 1) a_sum[n - 1] = a_sum[n - 2] + a[n - 1];
                else a_sum[0] = a[n-1];
                //sum = a_sum[n];
                for (int i = 0; i < n; i++)
                {
                    if (a_sum[i]>= (a_sum[n-1] +1)/ 2)
                    {
                        ekv = i + 1;
                        break;
                    }
                }
            }

            //вывод решения
            Console.WriteLine(ekv.ToString());
        }
    }
}


using System;
using System.Linq;

namespace _962A_Equator
{
    class Program
    {
        static void Main(string[] args)
        {

            int n = int.Parse(Console.ReadLine());
            int i;

            var input = Console.ReadLine().Split().Select(int.Parse);
            int[] tasks = input.ToArray();

            int total = tasks.Sum();

            int equator = total % 2 == 1 ? (total / 2) + 1 : total / 2;

            int temp = 0;
            for (i = 0; i < n; i++)
            {
                temp += tasks[i];

                if (temp >= equator) break;
            }

            Console.WriteLine(i < n ? i + 1 : i);
            //if (i < n) Console.WriteLine(i + 1);
            //else Console.WriteLine(n);

        }
    }
}


using System;
using System.Linq;

class MainClass
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] problems = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        int sum = 0;
        int equator = (problems.Sum() + 1) / 2; // rounding-up division

        for (int i = 0; i < n; i++)
        {
            sum += problems[i];
            if (sum >= equator)
            {
                Console.WriteLine(i + 1);
                break;
            }
        }

    }
}


using System;
using System.Linq;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var counter = 0;
            var total = 0;
            var sum = 0;
            for (int i = 1; i < array.Length; i++)
            {
                sum += array[i];
            }
            for (int i = 1; i < array.Length; i++)
            {
                total += array[i];
                if (total >= sum / 2.0)
                {
                    Console.WriteLine(i);
                    return;
                }
            }
        }
    }
}


using System;
using System.Linq;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += array[i];
                counter++;
                var remain = 0;
                for (int j = i + 1; j < array.Length; j++)
                {
                    remain += array[j];
                    if (remain > total) break;
                }
                if (total >= remain)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ');
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += int.Parse(array[i]);
                counter++;
                if (total >= countTasks || total >= countTasks / 2)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ');
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += int.Parse(array[i]);
                counter++;
                var remain = 0;
                for (int j = i + 1; j < array.Length; j++)
                {
                    remain += int.Parse(array[j]);
                }
                if (total >= remain)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ');
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += int.Parse(array[i]);
                counter++;
                if (total >= countTasks)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;
using System.Linq;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += array[i];
                counter++;
                var remain = 0;
                for (int j = i + 1; j < array.Length; j++)
                {
                    remain += array[j];
                }
                if (total >= remain)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ');
            var counter = 0;
            var total = 0;
            for (int i = 0; i < array.Length; i++)
            {
                total += int.Parse(array[i]);
                counter++;
                var remain = 0;
                for (int j = i + 1; j < array.Length; j++)
                {
                    remain += int.Parse(array[j]);
                }
                if (total == remain || total >= countTasks)
                {
                    Console.WriteLine(counter);
                    return;
                }
            }
        }
    }
}


using System;
using System.Linq;

namespace Ctask
{
    class Program
    {
        static void Main(string[] args)
        {
            var countTasks = Convert.ToInt32(Console.ReadLine());
            var array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var counter = 0;
            var total = 0;
            var sum = 0;
            for (int i = 0; i < array.Length; i++)
            {
                sum += array[i];
            }
            for (int i = 0; i < array.Length; i++)
            {
                total += array[i];
                if (total >= sum / 2.0)
                {
                    Console.WriteLine(i + 1);
                    return;
                }
            }
        }
    }
}


using System;

namespace codeforces962A
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = int.Parse(Console.ReadLine());
            double sum = 0,equator=0;
            long[] arr = Array.ConvertAll(Console.ReadLine().Split(), e => long.Parse(e));

            for (int i=0;i<n;i++)
                sum = sum + arr[i];

            //Console.WriteLine(Math.Ceiling(sum/2));

            for (int i = 0; i < n; i++)
            {
                equator = equator + arr[i];
                if (equator >= sum / 2)
                {
                    Console.WriteLine(i+1);
                    break;
                }
            }

        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace cfe42
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_cfe42A();
        }

        public static void solve_cfe42B()
        {

        }

        public static void solve_cfe42A()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            int sum = 0;

            for (int i = 0; i < n; i++)
            {
                sum += a[i];
            }

            int half = 0;
            int idx = 0;
            for (int i = 0; i < n; i++)
            {
                half += a[i];
                if (half >= sum / 2)
                {
                    idx = i;
                    break;
                }
            }

            Console.WriteLine(idx + 1);
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace cfe42
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.SetIn(new StreamReader("input.txt"));
            solve_cfe42A();
        }

        public static void solve_cfe42B()
        {

        }

        public static void solve_cfe42A()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            int sum = 0;

            for (int i = 0; i < n; i++)
            {
                sum += a[i];
            }

            int half = 0;
            int idx = 0;
            for (int i = 0; i < n; i++)
            {
                half += a[i];
                if (half >= (sum + 1) / 2)
                {
                    idx = i;
                    break;
                }
            }

            Console.WriteLine(idx + 1);
        }
    }
}


using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

namespace cfe42
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.SetIn(new StreamReader("input.txt"));
            //solve_cfe42A();
        }

        public static void solve_cfe42B()
        {

        }

        public static void solve_cfe42A()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);

            int sum = 0;

            for (int i = 0; i < n; i++)
            {
                sum += a[i];
            }

            int half = 0;
            int idx = 0;
            for (int i = 0; i < n; i++)
            {
                half += a[i];
                if (half >= sum / 2)
                {
                    idx = i;
                    break;
                }
            }

            Console.WriteLine(idx + 1);
        }
    }
}


using System;
using System.Linq;

namespace CSharp
{
    public class _962A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split().Select(token => int.Parse(token)).ToArray();

            int total = a.Sum();
            int soFar = 0;

            for (int i = 0; i < n; i++)
            {
                soFar += a[i];

                if (soFar * 2 >= total)
                {
                    Console.WriteLine(i + 1);
                    break;
                }
            }
        }
    }
}


using System;
using System.Linq;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int[] a = sc.IntArray();

        long sum = 0;
        foreach (var i in a)
        {
            sum += i;
        }

        long tmp = 0;
        for(int i = 0;i < n;i++)
        {
            tmp += a[i];
            if(tmp * 2 >= sum)
            {
                Console.WriteLine(i+1);
                return;
            }
        }
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Numerics;

namespace dhsmfeh_zhelddmf_gkqslek
{
    class Priority_queue<T>
    {
        static List<int> pq;
        public Priority_queue()
        {
            pq = new List<int>();
        }

        public void push(int num)
        {
            int idx = -1;

            if (pq.Count == 0)
            {
                pq.Add(num);
                return;
            }

            for (int i = pq.Count; --i > -1;)
            {
                if (pq[i] < num)
                {
                    idx = i + 1;
                    break;
                }
            }

            if (idx == -1) { idx = 0; }
            pq.Insert(idx, num);
        }

        public int pop(int num)
        {
            int answer = pq[num];
            pq.RemoveAt(num);
            return answer;
        }

        public int count
        {
            get
            {
                return pq.Count;
            }
        }
    }
    class Program
    {
        static StringBuilder sb = new StringBuilder();
        static void Main(string[] args)
        {
            int loop = int.Parse(Console.ReadLine());

            List<int> li = Console.ReadLine().Split().Select(int.Parse).ToList();

            double goal = li.Sum() / 2.0;
            int sum = 0;
            int index = 0;
            foreach(var item in li)
            {
                sum += item;
                index++;
                if(sum >= goal)
                {
                    Console.WriteLine(index);
                    return;
                }
            }
        }
    }
}


using System;

namespace Bassant1
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = int.Parse(Console.ReadLine());
            string[] tokens = Console.ReadLine().Split(' ');
            int[] arr = Array.ConvertAll(tokens, int.Parse);
            int avg = 0;

           for(int i = 0; i <length; i++)
            {
                avg += arr[i];

            }

            avg=(avg+1)/2;
            int check= 0;
            int k = 0;
            check += arr[k];

            while (check < avg )
            {
                k++;
                check += arr[k];

            }

            Console.WriteLine(k + 1);

            Console.ReadLine();
        }
    }
}