#include <iostream>

using namespace std;

void unos_niza(int a[],int n)
{
    for (int i=0;i<n;i++)
        cin >> a[i];
}

void ispis_niza(int a[],int n)
{
    for (int i=0;i<n;i++)
        cout << a[i] << endl;
}

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

int broj_jedinica(string a,int n)
{
    int i,k=0;
    for (i=0;i<n;i++)
        if (a[i]==1)
            k++;
    return k;
}

int broj_nula(string a,int n)
{
    int i,k=0;
    for (i=0;i<n;i++)
        if (a[i]==0)
            k++;
    return k;
}

int main()
{
    int n,c,q,i,j;
    cin >> n >> c >> q;
    string s;
    cin >> s;
    int l[q],r[q];
    unos_niza(l,q);
    unos_niza(r,q);
    int konacno[q];
    postavljanje_niza(konacno,q);
    for (i=0;i<q;i++)
        while (l[i]+r[i]<=n)
        {
            for (j=min(l[i],r[i]);j<max(l[i],r[i]);j++)
            {
                if (s[i]==0)
                    s[i]=1;
                else
                    s[i]=0;
            }
            if (broj_jedinica(s,n)>broj_nula(s,n))
                for (j=0;j<n;j++)
                {
                    if (s[i]==1)
                        s[i]=0;
                    else
                        s[i]=1;
                }
            konacno[i]=c+broj_jedinica(s,n)*c;
        }
    ispis_niza(konacno,q);
    return 0;
}