package finalset;

import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
  Drone Tracker.
  
  You are in charge of a fleet of unmanned drone spacecrafts. As part of a training
  mission, you have been asked to track the movement of a set of drones moving in 
  an imaginary two-dimensional plane divided into square unit regions. Each drone is 
  assigned an initial U(x,y) region and a velocity determined by two integers (dx, dy).
  After one second of flight, the drone located originally in the U(x,y) region moves  
  itself to the region U(x+dx, y+dy).
  
  Given a set of drones in the plane, define the concept of a BoundingRectangle to be
  the smallest rectangle (with purely horizontal and vertical edges) that wholly contains
  all drones in the fleet. The area of the rectangle is the sum total of the unit regions
  contained within the BoundingRectangle. If the fleet is composed of three drones, for 
  example: 
  
     * If all drones are located within the region U(2,2), then the area of the Bounding
       Rectangle is 1.
     * If the drones are located within regions U(5,6), U(5,7), and U(5,8) then the area
       of the BoundingRectangle is 3.
     * If the drones are located within regions U(-1,-2), U(2,1), and U(1,-3) then the
       area of the BoundingRectangle is 20. 
  
  You can assume that all drone movements are perfectly precise and that drone's cannot
  interfere and hit each other, even if two drones find themselves located at the exact
  same (x,y) location at the exact same time.
   
  Your task is to project the movement of the fleet of drones 180 seconds into the future
  and identify the earliest time (in seconds) when the BoundingRectangle of the fleet
  has the smallest area. Thus it may be possible for two distinct drone fleet configurations
  to have BoundingRectangles with the same area.
  
  Your Input will consist of a single line containing a positive integer N > 2 of drones 
  in the fleet. Thereafter, there will be N lines each containing a line of the form:
   
     x y dx dy
     
  representing a drone initially located at location (x,y) with fixed velocity of (dx, dy).
  
  Your Output will consist of a single line containing a non-negative integer and a positive
  integer separated by a space. The first non-negative integer represents the time 
  0 <= T <= 180 and the second positive integer A representing the area of the smallest 
  BoundingRectangle of the drone fleet at time T. 
  
*/
class BoundingRectangle  {
	public  int left, right, top, down;
	public  boolean lb = true, rb = true, tb = true, db = true;
	
	public void left( int x, int y) {
		if (lb) { left = x; lb = false; return; }
		if (x < left) left = x;
	}
	
	public void right( int x, int y) {
		if (rb) { right = x; rb = false; return; }
		if (x > right) right = x;
	}
	
	public void top( int x, int y) {
		if (tb) { top = y; tb = false; return; }
		if (y > top) top = y;
	}
	
	public void down( int x, int y) {
		if (db) { down = y; db = false; return; }
		if (y < down) down = y;
	}
	
	public void update (Point p) {
		int x = p.x;
		int y = p.y;
		left(x,y);
		right(x,y);
		top(x,y);
		down(x,y);
	}
	
	public int area () {
		boolean vertical = false;
		boolean horizontal = false;
		
		if (left == right) vertical = true;
		if (top == down) horizontal = true;
		
		// single point.
		if (horizontal && vertical) return 1;
		
		if (horizontal) { return (right-left+1); }
		if (vertical) { return (top - down + 1); }
		
		// a rectangle
		return (right-left+1)*(top-down+1);
	}

}

class Drone {
	int x;
	int y;
	
	int dx;
	int dy;
	
	public Drone (int x, int y, int dx, int dy) {
		this.x = x;
		this.y = y;
		this.dx = dx;
		this.dy = dy;
	}
	
	public void move () {
		x += dx;
		y += dy;
	}
	
	public Point getLocation () {
		return new Point (x, y);
	}
}

class Fleet {
	ArrayList<Drone> al = new ArrayList<Drone>();
	
	public Fleet () {
		
	}
	
	public void add (Drone d) {
		al.add (d);
	}
	
	public BoundingRectangle boundingRectangle() {
		BoundingRectangle br = new BoundingRectangle();
		
		for (Drone d: al) {
			br.update(d.getLocation());
		}
		
		return br;
	}

	public void move() {
		
		for (Drone d: al) {
			d.move();
		}

	}
	
}

public class Problem6 {
	
	static boolean DEBUG = false;
	
	// read in the input
	public static void main (String args[]) {
		Scanner sc = new Scanner(System.in);
		System.out.print(process(sc));
	}
	
	
	// for testing
	public static String process (Scanner sc) {
		int N = Integer.valueOf(sc.nextLine());
		
		Fleet f = new Fleet();
		while (N-- > 0) {
			String s = sc.nextLine();
			StringTokenizer st = new StringTokenizer (s);
			int x = Integer.valueOf(st.nextToken());
			int y = Integer.valueOf(st.nextToken());
			int dx = Integer.valueOf(st.nextToken());
			int dy = Integer.valueOf(st.nextToken());
			
			f.add(new Drone (x,y,dx,dy));
		}
		
		// project out 180 seconds into the future.
		BoundingRectangle small = f.boundingRectangle();
		int smallTime = 0;
		
		int t = 0;
		while (++t <= 180) {
			
			// move forward
			f.move();
			
			BoundingRectangle br2 = f.boundingRectangle();
			
			if (DEBUG) { System.out.println (t + ". " + small.area() + " :: " + br2.area()); }

			if (br2.area() < small.area()) {
				smallTime = t;
				small = br2;
			}
		}
		
		return smallTime + " " + small.area() + "\n";
	}
	
}