#include <cstdio>
#include <algorithm>
//sort pairs of coordinates by value
void sbv(double &x1, double &x2, double &y1, double &y2)
{
    if( x1 > x2 ) std::swap( x1 , x2 );
    if( y1 > y2 ) std::swap( y1 , y2 );
}
//find whether the rectangles intersect
bool intersect( double b1, double e1, double b2, double e2 )
{
    //"b" for "beginning", "e" for "end" (imagine the line segments on the coordinate axis)
    if( b2 >= e1 || e2 <= b1 ) return false;
    return true;
}

int main()
{
    double a, b, c, d; //meaningful coodinates of rectangle sides
    int n; scanf( "%d", &n );
    scanf( "%lg %lg %lg %lg", &a, &b, &c, &d );
    double x1 = a, x2 = b, y1 = c, y2 = d; //"x" and "y" pairs are for rectangle of common area
    for( int i=1; i<n; i++ )
    {
        scanf( "%lg %lg %lg %lg", &a, &b, &c, &d ); //refresh the coords.
        if( intersect( x1, x2, a, b ) && intersect( y1, y2, c, d ) ) //if they intersect
        {
            sbv( a, x1, x2, b ); //sort again to find the inner points
            sbv( c, y1, y2, d ); //(image is attached)
            printf("Common area of %d rectangles S = %lg\n", i+1, (y2-y1)*(x2-x1) );
        }
        else
        {
            printf("System of rectangles has no common area.\n");
            break;
        }

    }
    return 0;
}
