import java.io.*; import java.util.*; import java.math.*; import java.text.*; public class diplomatic { public static void main(String[] args) throws Exception { BufferedReader f = new BufferedReader(new FileReader("diplomatic.in")); StringTokenizer st; String line; while ((line = f.readLine()) != null) { st = new StringTokenizer(line); long num = Long.parseLong(st.nextToken()); //long x[]= new long[num]; //long y[]= new long[num]; long x1, y1, x2, y2, x0 ,y0; System.out.print(num+" "); x1 = Long.parseLong(st.nextToken()); y1 = Long.parseLong(st.nextToken()); x0 = x1; y0 = y1; for (int i = 1; i < num; i++) { x2 = Long.parseLong(st.nextToken()); y2 = Long.parseLong(st.nextToken()); System.out.print(((x2+x1)/2l)+" "+((y2+y1)/2l)+" "); x1 = x2; y1 = y2; } System.out.print((x1+x0)/2l+" "+(y1+y0)/2l+"\n"); } } }