#include "..\..\..\lib\testlib.h"

using namespace std;

const int MAXL = 200000;
const int MAXW = 10000;
const int MAXN = 2000;
const int MAXC = 100000;

int main(){
    registerValidation();

    inf.readInt(1,MAXL,"l");
    inf.readSpace();
    inf.readInt(1,MAXW,"w");
    inf.readEoln();
    int n = inf.readInt(1,MAXN,"n");
    inf.readEoln();

    int last = 0;

    for (int i = 0; i < n; i++){
        last = inf.readInt(last+1,MAXC,"a["+vtos(i)+"]");
        if (i == n-1)
            inf.readEoln();
        else
            inf.readSpace();    
    }

    int m = inf.readInt(1,MAXN,"m");
    inf.readEoln();

    last = 0;

    for (int i = 0; i < m; i++){
        last = inf.readInt(last+1,MAXC,"b["+vtos(i)+"]");
        if (i == m-1)
            inf.readEoln();
        else
            inf.readSpace();    
    }

    inf.readEof();
    return 0;
}
