import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.Scanner;

public class cakeviz_sm {

	public static void main(String[] args) throws FileNotFoundException {
		Locale.setDefault(Locale.US);
		double div = 1;
		{
			Scanner infile = new Scanner(new File(args[0]));
			infile.nextInt();
			int m = infile.nextInt();
			for (int i = 0; i < m; i++) {
				int x = infile.nextInt();
				int y = infile.nextInt();
				div = Math.max(div, Math.abs(x));
				div = Math.max(div, Math.abs(y));
			}
		}
		div /= 5;
		Scanner infile = new Scanner(new File(args[0]));
		Scanner outfile = new Scanner(new File(args[1]));
		PrintWriter out = new PrintWriter(args[2]);
		if (args.length == 4) {
			div = Double.parseDouble(args[3]);
		}
		out.println("u=1cm;");
		out.println("beginfig(1)");
		int n = infile.nextInt();
		int m = infile.nextInt();
		out.print("draw ");
		for (int i = 0; i < m; i++) {
			int x = infile.nextInt();
			int y = infile.nextInt();
			out.print("(" + x / div + "u, " + y / div + "u)--");
		}
		out.println("cycle  withpen pencircle scaled 2pt;");
		for (int i = 0; i < n; i++) {
			int k = outfile.nextInt();
			out.print("draw ");
			for (int j = 0; j < k; j++) {
				double x = outfile.nextDouble();
				double y = outfile.nextDouble();
				out.print("(" + x / div + "u, " + y / div + "u)--");
			}
			out.println("cycle;");
		}
		out.println("endfig;");
		out.println("bye.");
		out.close();
	}
}
