One drew a closed polyline on a plane, that consisted only of vertical and horizontal segments (parallel to the coordinate axes). The segments alternated between horizontal and vertical ones (a horizontal segment was always followed by a vertical one, and vice versa). The polyline did not contain strict self-intersections, which means that in case any two segments shared a common point, that point was an endpoint for both of them (please consult the examples in the notes section).

Unfortunately, the polyline was erased, and you only know the lengths of the horizonal and vertical segments. Please construct any polyline matching the description with such segments, or determine that it does not exist.

Input

The first line contains one integer t (1 ≤ t ≤ 200) —the number of test cases.

The first line of each test case contains one integer h (1 ≤ h ≤ 1000) — the number of horizontal segments. The following line contains h integers l_1, l_2, ..., l_h (1 ≤ l_i ≤ 1000) — lengths of the horizontal segments of the polyline, in arbitrary order.

The following line contains an integer v (1 ≤ v ≤ 1000) — the number of vertical segments, which is followed by a line containing v integers p_1, p_2, ..., p_v (1 ≤ p_i ≤ 1000) — lengths of the vertical segments of the polyline, in arbitrary order.

Test cases are separated by a blank line, and the sum of values h + v over all test cases does not exceed 1000.

Output

For each test case output Yes, if there exists at least one polyline satisfying the requirements, or No otherwise. If it does exist, in the following n lines print the coordinates of the polyline vertices, in order of the polyline traversal: the i-th line should contain two integers x_i and y_i — coordinates of the i-th vertex.

Note that, each polyline segment must be either horizontal or vertical, and the segments should alternate between horizontal and vertical. The coordinates should not exceed 10^9 by their absolute value.

Examples

Input


2
2
1 1
2
1 1

2
1 2
2
3 3


Output


Yes
1 0
1 1
0 1
0 0
No


Input


2
4
1 1 1 1
4
1 1 1 1

3
2 1 1
3
2 1 1


Output


Yes
1 0
1 1
2 1
2 2
1 2
1 1
0 1
0 0
Yes
0 -2
2 -2
2 -1
1 -1
1 0
0 0


Input


2
4
1 4 1 2
4
3 4 5 12

4
1 2 3 6
2
1 3


Output


Yes
2 0
2 3
3 3
3 7
4 7
4 12
0 12
0 0
No

Note

In the first test case of the first example, the answer is Yes — for example, the following picture illustrates a square that satisfies the requirements: 

<image>

In the first test case of the second example, the desired polyline also exists. Note that, the polyline contains self-intersections, but only in the endpoints: 

<image>

In the second test case of the second example, the desired polyline could be like the one below: 

<image>

Note that the following polyline is not a valid one, since it contains self-intersections that are not endpoints for some of the segments: 

<image>
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.stream.IntStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.io.IOException;
import java.util.stream.Collectors;
import java.util.ArrayList;
import java.io.UncheckedIOException;
import java.util.List;
import java.util.stream.Stream;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            DRectangularPolyline solver = new DRectangularPolyline();
            int testCount = Integer.parseInt(in.next());
            for (int i = 1; i <= testCount; i++)
                solver.solve(i, in, out);
            out.close();
        }
    }

    static class DRectangularPolyline {
        int limit = 250;
        byte[][] dp = new byte[limit * 2 + 1][limit * 1000 + 1];

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int h = in.readInt();
            int[] hl = new int[h];
            in.populate(hl);
            int v = in.readInt();
            int[] vl = new int[v];
            in.populate(vl);

            if (h != v || Arrays.stream(hl).sum() % 2 != 0 ||
                    Arrays.stream(vl).sum() % 2 != 0) {
                out.println("No");
                return;
            }

            List<Integer>[] vlist = part(vl);
            List<Integer>[] hlist = part(hl);
            if (vlist == null || hlist == null) {
                out.println("No");
                return;
            }

            if (hlist[0].size() > hlist[1].size()) {
                SequenceUtils.swap(hlist, 0, 1);
            }
            if (vlist[1].size() > vlist[0].size()) {
                SequenceUtils.swap(vlist, 0, 1);
            }

            hlist[1] = hlist[1].stream().map(x -> -x).collect(Collectors.toList());
            vlist[1] = vlist[1].stream().map(x -> -x).collect(Collectors.toList());
            hlist[0].sort(Comparator.naturalOrder());
            vlist[0].sort(Comparator.reverseOrder());
            hlist[1].sort(Comparator.reverseOrder());
            vlist[1].sort(Comparator.naturalOrder());
            int[][] chance = new int[][]{
                    {0, 0},
                    {1, 0},
                    {1, 1},
                    {0, 1}
            };


            out.println("Yes");
            int curX = 0;
            int curY = 0;
            for (int[] c : chance) {
                int x = c[0];
                int y = c[1];

                while (!hlist[x].isEmpty() && !vlist[y].isEmpty()) {
                    curX += pop(hlist[x]);

                    out.append(curX).append(' ').append(curY).println();
                    curY += pop(vlist[y]);

                    out.append(curX).append(' ').append(curY).println();
                }
            }
        }

        public int pop(List<Integer> list) {
            return list.remove(list
                    .size() - 1);
        }

        public List<Integer>[] part(int[] a) {
            int n = a.length;

            int sum = Arrays.stream(a).sum();
            int half = sum / 2;
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= half; j++) {
                    dp[i][j] = -1;
                }
            }

            dp[0][0] = 0;
            for (int i = 1; i <= n; i++) {
                int v = a[i - 1];
                for (int j = 0; j <= half; j++) {
                    dp[i][j] = (byte) (dp[i - 1][j] == -1 ? -1 : 0);
                    if (j >= v && dp[i - 1][j - v] >= 0) {
                        dp[i][j] = 1;
                    }
                }
            }

            if (dp[n][half] == -1) {
                return null;
            }

            List<Integer>[] ans = new List[2];
            for (int i = 0; i < 2; i++) {
                ans[i] = new ArrayList<>();
            }
            int x = n;
            int y = half;
            while (x > 0) {
                if (dp[x][y] == 0) {
                    ans[1].add(a[x - 1]);
                    x--;
                } else {
                    ans[0].add(a[x - 1]);
                    y -= a[x - 1];
                    x--;
                }
            }

            return ans;
        }

    }

    static class SequenceUtils {
        public static <T> void swap(T[] data, int i, int j) {
            T tmp = data[i];
            data[i] = data[j];
            data[j] = tmp;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 1 << 13;
        private final Writer os;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(String c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput println(String c) {
            return append(c).println();
        }

        public FastOutput println() {
            return append(System.lineSeparator());
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class FastInput {
        private final InputStream is;
        private StringBuilder defaultStringBuf = new StringBuilder(1 << 13);
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        public void populate(int[] data) {
            for (int i = 0; i < data.length; i++) {
                data[i] = readInt();
            }
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public String next() {
            return readString();
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

        public String readString(StringBuilder builder) {
            skipBlank();

            while (next > 32) {
                builder.append((char) next);
                next = read();
            }

            return builder.toString();
        }

        public String readString() {
            defaultStringBuf.setLength(0);
            return readString(defaultStringBuf);
        }

    }
}

