// This Code was made by Chinese_zjc_.
#include<bits/stdc++.h>
using type=double;
struct point{
    type x,y;
    point():x(),y(){}
    point(type x_,type y_):x(x_),y(y_){}
    point& operator+=(const point &X){return x+=X.x,y+=X.y,*this;}
    point& operator-=(const point &X){return x-=X.x,y-=X.y,*this;}
    point& operator*=(const type &X){return x*=X,y*=X,*this;}
    friend point operator+(const point &A,const point &B){return point(A)+=B;}
    friend point operator-(const point &A,const point &B){return point(A)-=B;}
    friend point operator*(const point &A,const type &B){return point(A)*=B;}
    friend type operator*(const point &A,const point &B){return A.x*B.x+A.y*B.y;}
    friend type operator/(const point &A,const point &B){return A.x*B.y-A.y*B.x;}
    friend point intersection(const point &A,const point &B,const point &C,const point &D)
    // intersection of AB and CD
    {
        return C+(D-C)*(((B-A)/(C-A))/((B-A)/(C-D)));
    }
    friend std::ostream&operator<<(std::ostream&A,const point &B)
    {
        return A<<'('<<B.x<<','<<B.y<<')';
    }
};
signed main()
{
    std::ios::sync_with_stdio(false);
    point A={1,1},B={2,0},C={5,9},D={0,2};
    std::cout<<intersection(A,B,C,D)<<std::endl;
    return 0;
}