// Arup Guha
// 7/21/2025
// Solution to 2025 SI@UCF Contest #4 Problem: Sprinkles the Domino Destructor

import java.util.*;
import java.io.*;

public class sprinkles {

	public static int n;
	public static TreeSet<Integer> stops;
	public static TreeSet<Integer> addedStops;
	public static int[] sum;
	
	public static void main(String[] args) throws Exception {
	
		FastScanner stdin = new FastScanner(System.in);
		int nC = stdin.nextInt();
		
		// Process cases.
		for (int loop=0; loop<nC; loop++) {
			
			n = stdin.nextInt();
			int numS = stdin.nextInt();
			int numQ = stdin.nextInt();
			
			// Set these up.
			stops = new TreeSet<Integer>();
			addedStops = new TreeSet<Integer>();
			
			// Using the odd indexes for the dominos.
			sum = new int[2*n+1];
			
			// Read in the dominos to the odd indexes.
			for (int i=1; i<2*n+1; i+=2)
				sum[i] = stdin.nextInt();
				
			// Prefix sum from left.
			for (int i=1; i<sum.length; i++)
				sum[i] += sum[i-1];
				
			// Stoppers are on even indexes.
			for (int i=0; i<numS; i++) 
				stops.add(2*stdin.nextInt());
				
			// These are default stoppers so put them in!
			stops.add(0);
			stops.add(2*n);
			
			// Put answer here.
			StringBuffer sb = new StringBuffer();
			
			// Process queries.
			for (int i=0; i<numQ; i++) {
			
				// Query type.
				int type = stdin.nextInt();
			
				// Process Sprinkles' knocking stuff over.
				if (type == 1) {
						
					// Get query.
					int dNum = stdin.nextInt();
					char dir = stdin.next().charAt(0);
					
					// Going forward.
					if (dir == 'R') {
						
						// Look to see where this will stop.
						int to = stops.higher(2*dNum-1);
						
						// How many Sprinkles hits down.
						int down = sum[to] - sum[2*dNum-2];
						sb.append(down+"\n");
						
						// Now this becomes an added stop on the left!
						if (!stops.contains(2*dNum-2)) {
							stops.add(2*dNum-2);
							addedStops.add(2*dNum-2);
						}
					}
					
					// Backwards.
					else {
					
						// Where we will stop.
						int to = stops.lower(2*dNum-1);
					
						// How many Sprinkles hits down.
						int down = sum[2*dNum-1] - sum[to];
						sb.append(down+"\n");
						
						// Now this becomes an added stop to the right.
						if (!stops.contains(2*dNum)) {
							stops.add(2*dNum);
							addedStops.add(2*dNum);
						}
					}
				}
				
				// Undo everything.
				else {
				
					// These get taken out, so prefix sums work again...
					for (Integer x: addedStops)
						stops.remove(x);
						
					// Empty this out.
					addedStops.clear();
				}
			
			}
			
			// All the output for the case.
			System.out.print(sb);
		}
	}
}

class FastScanner {
	BufferedReader br;
	StringTokenizer st;
	public FastScanner(InputStream i){
		br = new BufferedReader(new InputStreamReader(i));
		st = new StringTokenizer("");
	}
	public String next() throws IOException{
		if(st.hasMoreTokens())
			return st.nextToken();
		else
			st = new StringTokenizer(br.readLine());
		return next();
	}
	public int nextInt() throws IOException{
		return Integer.parseInt(next());
	}
	public long nextLong() throws IOException{
		return Long.parseLong(next());
	}
	public double nextDouble() throws IOException{
		return Double.parseDouble(next());
	}
}