import java.util.*;
import java.io.*;

public class visual {
public static void main(String[] arg) {	
		if (arg.length < 1) {
			System.out.println("java visual <input file> <output file>");
		} else {
			new visual().run(arg[0], arg[1]);
		}
	}

	public void run(String inf, String ouf) {
		try {
			Locale.setDefault(Locale.US);			

			Scanner in = new Scanner(new File(inf));			
			int n = in.nextInt();
			double minX = 1e5;
			double maxX = -1e5;
			double minY = 1e5;
			double maxY = -1e5;
			for (int i = 0; i < n; ++i) {
				double x = in.nextDouble();
				double y = in.nextDouble();
				minX = Math.min(x, minX);
				minY = Math.min(y, minY);
				maxX = Math.max(x, maxX);
				maxY = Math.max(y, maxY);
			}

			double scale = 1e5;
			if (maxX - minX > 0) {
				scale = Math.min(scale, 20 / (maxX - minX));
			}
			if (maxY - minY > 0) {
				scale = Math.min(scale, 20 / (maxY - minY));
			}

			PrintWriter out = new PrintWriter("picture.mp");
			out.println("u := 1cm;");
			out.println("beginfig(1)");

			out.print("fill ");		
			in = new Scanner(new File(ouf));			
			n = in.nextInt();		
			for (int i = 0; i < n; ++i) {
				double x = in.nextDouble();
				double y = in.nextDouble();
				out.printf("(%fu, %fu)--", (x - minX) * scale, (y - minY) * scale);
			}
			out.println("cycle withcolor .6 white;");

			out.print("fill ");		
			in = new Scanner(new File(inf));			
			n = in.nextInt();		
			for (int i = 0; i < n; ++i) {
				double x = in.nextDouble();
				double y = in.nextDouble();
				out.printf("(%fu, %fu)--", (x - minX) * scale, (y - minY) * scale);
			}
			out.println("cycle withcolor .5 green;");

/*
			out.print("draw ");		
			in = new Scanner(new File(ouf));			
			n = in.nextInt();		
			for (int i = 0; i < n; ++i) {
				double x = in.nextDouble();
				double y = in.nextDouble();
				out.printf("(%fu, %fu)--", (x - minX) * scale, (y - minY) * scale);
			}
			out.println("cycle withpen pencircle scaled 1bp;"); */

			out.println("endfig;");
			out.println("end;");
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}

}