#include "stdafx.h"
#include<iostream>
using namespace std;
int main()
{
int x, y, a1, a2, b1, b2, c1, c2;
cin >> x >> y >> a1 >> a2 >> b1 >> b2 >> c1 >> c2;
if (a1*b2-a2*b1>=0.0001||abs())
{
cout << a1*x + b1*y + c1 = 0;
cout << a2*x + b2*y - c2 = 0;
}
system("pause");
return 0;
}