#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void){
    int n;
    double x1, x2, y1, y2, x3, y3, x, y, xx, yy;
    while(scanf("%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
        xx = (x2-x1)/(y2-y1);
        yy = (y2-y1)/(x2-x1);
        x = x1 + (y3-y1)*xx;
        y = y1-yy*x1+yy*x3;
        cout << x << y << endl;
    }

    return 0;
}

