func_code_string: #include <bits/stdc++.h>   using namespace std;   const int intmax = 0x3f3f3f3f;   const long long lldmax = 0x3f3f3f3f3f3f3f3fll;   double eps = 1e-8;   template <class T>   inline void checkmin(T &a, T b) {     if (b < a) a = b;   }   template <class T>   inline void checkmax(T &a, T b) {     if (b > a) a = b;   }   template <class T>   inline T sqr(T x) {     return x * x;   }   template <class T>   inline T lowbit(T n) {     return (n ^ (n - 1)) & n;   }   template <class T>   inline int countbit(T n) {     return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));   }   template <class T>   inline T checkmod(T n, T m) {     return (n % m + m) % m;   }   template <class T>   inline T gcd(T a, T b) {     if (a < 0) return gcd(-a, b);     if (b < 0) return gcd(a, -b);     return (b == 0) ? a : gcd(b, a % b);   }   template <class T>   inline T euclid(T a, T b, T &x, T &y) {     if (a < 0) {       T d = euclid(-a, b, x, y);       x = -x;       return d;     }     if (b < 0) {       T d = euclid(a, -b, x, y);       y = -y;       return d;     }     if (b == 0) {       x = 1;       y = 0;       return a;     } else {       T d = euclid(b, a % b, x, y);       T t = x;       x = y;       y = t - (a / b) * y;       return d;     }   }   template <class T>   inline int dblcmp(T a, const T b) {     a -= b;     return a > eps ? 1 : (a < -eps ? -1 : 0);   }   template <class T>   inline int sgn(T a) {     return a > eps ? 1 : (a < -eps ? -1 : 0);   }   long long ans[4];   long long x, y;   long long n, m, a, b;   long long dis(long long x1, long long y1, long long x2, long long y2) {     return sqr(x * 2 - x1 - x2) + sqr(y * 2 - y1 - y2);   }   void update(long long x1, long long y1, long long x2, long long y2) {     bool copy = false;     long long tmp[4];     tmp[0] = x1, tmp[1] = y1, tmp[2] = x2, tmp[3] = y2;     if (x1 < 0 || x1 > n) return;     if (x2 < 0 || x2 > n) return;     if (y1 < 0 || y1 > m) return;     if (y2 < 0 || y2 > m) return;     if (x1 > x || x2 < x) return;     if (y1 > y || y2 < y) return;     if (x1 == x2 || y1 == y2) return;     long long dy = y2 - y1, dx = x2 - x1;     long long g = gcd(dy, dx);     dy /= g, dx /= g;     if (dy * a != dx * b) {       return;     }     if (ans[0] == -1) {       copy = true;     } else {       long long da = dis(ans[0], ans[1], ans[2], ans[3]);       long long db = dis(x1, y1, x2, y2);       if (db < da) {         copy = true;       } else if (db == da) {         for (long long i = 0; i < 4; ++i) {           if (tmp[i] < ans[i]) {             copy = true;           }           if (tmp[i] != ans[i]) break;         }       }     }     if (copy) {       for (long long i = 0; i < 4; ++i) ans[i] = tmp[i];     }   }   int main() {     memset(ans, 0xff, sizeof(ans));     cin >> n >> m >> x >> y >> a >> b;     long long g = gcd(a, b);     a /= g;     b /= g;     long long mul = lldmax;     checkmin(mul, n / a);     checkmin(mul, m / b);     a *= mul, b *= mul;     update(0, 0, a, b);     update(0, m - b, a, m);     update(n - a, 0, n, b);     update(n - a, m - b, n, m);     int ta = a / 2, tb = b / 2;     update(x - ta, y - tb, x + a - ta, y + b - tb);     update(0, y - tb, a, y + b - tb);     update(n - a, y - tb, n, y + b - tb);     update(x - ta, 0, x + a - ta, b);     update(x - ta, m - b, x + a - ta, m);     ta++;     update(x - ta, y - tb, x + a - ta, y + b - tb);     update(0, y - tb, a, y + b - tb);     update(n - a, y - tb, n, y + b - tb);     update(x - ta, 0, x + a - ta, b);     update(x - ta, m - b, x + a - ta, m);     tb++;     update(x - ta, y - tb, x + a - ta, y + b - tb);     update(0, y - tb, a, y + b - tb);     update(n - a, y - tb, n, y + b - tb);     update(x - ta, 0, x + a - ta, b);     update(x - ta, m - b, x + a - ta, m);     ta--;     update(x - ta, y - tb, x + a - ta, y + b - tb);     update(0, y - tb, a, y + b - tb);     update(n - a, y - tb, n, y + b - tb);     update(x - ta, 0, x + a - ta, b);     update(x - ta, m - b, x + a - ta, m);     for (int i = 0; i < 4; ++i) {       cout << ans[i] <<    ;     }     cout << endl;     return 0;   }   