// i wants to take ioi
//binhtinhtutinkhongcaycunhungmotkhikhongcontutinnualatuyetvong
#include <bits/stdc++.h>

using namespace std;

#define int long long
#define nn "\n"
#define pi pair<int, int>
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define eb emplace_back
#define pb push_back
#define TASK "TUGIAC"

#define ms(a, x) memset(a, x, sizeof(a))
#define all(a) a.begin(), a.end()
#define All(a, n) a + 1, a + 1 + n

#define LOG 19

const int INF = 1e18;
const int mod = 1e9;
const int N = 1e5 + 5;
const int MOD = 998244353;

int bit[200000];

struct Point{
    int x, y;
};

Point p[5];

void nhap(){
    for(int i = 1; i <= 4; i++)
        cin >> p[i].x >> p[i].y;
}

int cross(Point a, Point b, Point c){
    return (b.x - a.x) * (c.y - a.y)
         - (b.y - a.y) * (c.x - a.x);
}

int sign(int x){
    if(x > 0) return 1;
    if(x < 0) return -1;
    return 0;
}

bool trenDoan(Point a, Point b, Point c){
    return min(a.x, b.x) <= c.x && c.x <= max(a.x, b.x)
        && min(a.y, b.y) <= c.y && c.y <= max(a.y, b.y)
        && cross(a, b, c) == 0;
}
bool giaoNhau(Point a, Point b, Point c, Point d){
    int u = cross(a, b, c);
    int v = cross(a, b, d);
    int w = cross(c, d, a);
    int z = cross(c, d, b);
    if(sign(u) * sign(v) < 0 && sign(w) * sign(z) < 0)
        return true;
    if(u == 0 && trenDoan(a, b, c)) return true;
    if(v == 0 && trenDoan(a, b, d)) return true;
    if(w == 0 && trenDoan(c, d, a)) return true;
    if(z == 0 && trenDoan(c, d, b)) return true;
    return false;
}

long double dienTich(Point a, Point b, Point c){
    return fabsl(((long double)b.x - a.x) * ((long double)c.y - a.y) - ((long double)b.y - a.y) * ((long double)c.x - a.x)) / 2.0L;
}

void solve(){
    for(int i = 1; i <= 4; i++){
        for(int j = i + 1; j <= 4; j++){
            if(p[i].x == p[j].x && p[i].y == p[j].y){
                cout << 0 << nn;
                return;
            }
        }
    }
    bool g1 = giaoNhau(p[1], p[2], p[3], p[4]);
    bool g2 = giaoNhau(p[2], p[3], p[4], p[1]);
    if(g1 || g2){
        Point a = p[1], b = p[2], c = p[3], d = p[4];
        long double dt = 0;
        if(g1){
            int vx = b.x - a.x;
            int vy = b.y - a.y;
            int ux = d.x - c.x;
            int uy = d.y - c.y;
            long double mau = (long double)vx * uy - (long double)vy * ux;
            if(mau == 0){
                cout << 0 << nn;
                return;
            }
            long double t = ((long double)(c.x - a.x) * uy - (long double)(c.y - a.y) * ux) / mau;

            long double qx = a.x + t * vx;
            long double qy = a.y + t * vy;

            dt = fabsl((long double)(a.x - qx) * (d.y - qy) - (long double)(a.y - qy) * (d.x - qx)) / 2.0L + fabsl((long double)(b.x - qx) * (c.y - qy) - (long double)(b.y - qy) * (c.x - qx)) / 2.0L;
        }
        else{
            a = p[2];
            b = p[3];
            c = p[4];
            d = p[1];
            int vx = b.x - a.x;
            int vy = b.y - a.y;
            int ux = d.x - c.x;
            int uy = d.y - c.y;
            long double mau = (long double)vx * uy - (long double)vy * ux;
            if(mau == 0){
                cout << 0 << nn;
                return;
            }

            long double t = ((long double)(c.x - a.x) * uy - (long double)(c.y - a.y) * ux) / mau;
            long double qx = a.x + t * vx;
            long double qy = a.y + t * vy;
            dt = fabsl((long double)(p[1].x - qx) * (p[2].y - qy) - (long double)(p[1].y - qy) * (p[2].x - qx)) / 2.0L
   + fabsl((long double)(p[3].x - qx) * (p[4].y - qy)
         - (long double)(p[3].y - qy) * (p[4].x - qx)) / 2.0L;
        }
        if(dt == 0){
            cout << 0 << nn;
            return;
        }
        cout << 3 << nn;
        cout << fixed << setprecision(3) << dt << nn;
        return;
    }

    int c1 = cross(p[1], p[2], p[3]);
    int c2 = cross(p[2], p[3], p[4]);
    int c3 = cross(p[3], p[4], p[1]);
    int c4 = cross(p[4], p[1], p[2]);
    if(c1 == 0 || c2 == 0 || c3 == 0 || c4 == 0){
        cout << 0 << nn;
        return;
    }
    int loai = 1;
    if(!(sign(c1) == sign(c2) && sign(c2) == sign(c3) && sign(c3) == sign(c4))) loai = 2;

    long double dt = fabsl((long double)p[1].x * p[2].y - (long double)p[1].y * p[2].x + (long double)p[2].x * p[3].y - (long double)p[2].y *p[3].x + (long double)p[3].x * p[4].y - (long double)p[3].y * p[4].x + (long double)p[4].x * p[1].y - (long double)p[4].y * p[1].x) / 2.0L;
    if(dt == 0){
        cout << 0 << nn;
        return;
    }
    cout << loai << nn;
    cout << fixed << setprecision(3) << dt << nn;
}
signed main(){
    if(fopen(TASK".INP", "r")){
        freopen(TASK".INP", "r", stdin);
        freopen(TASK".OUT", "w", stdout);
    }
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    nhap();
    solve();
    return (0 ^ 0);
}