#include <set>
#include <map>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iomanip>
#include <complex>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <deque>
#include <bitset>
#include <cctype>
#include <utility>
#include <cassert>
using namespace std;
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define SZ(S) ((int) ((S).size()))
#define DEBUG(x) { cout << #x << " = " << x << endl; }
#define PR(a,n) { cout << #a << " = "; FOR(_,1,n) cout << a[_] << ' '; cout << endl; }
#define PR0(a,n) { cout << #a << " = "; REP(_,n) cout << a[_] << ' '; cout << endl; }
vector< pair<int, pair<int,int> > > all;
int mysqrt(int x) {
int a = sqrt(x);
while (a * a < x) ++a;
while (a * a > x) --a;
return a;
}
int S, P;
#define sqr(x) ((x) * (x))
bool check(int x1, int y1, int x2, int y2, int c) {
if (c*c == sqr(x1-x2) + sqr(y1-y2)) {
cout << "Dream" << endl << 0 << ' ' << 0 << endl << x1 << ' ' << y1 << endl << x2 << ' ' << y2 << endl;
return true;
}
return false;
}
void solve() {
long long prod = S * (long long) S / (P/2);
FOR(a,1,P/2-1) if (prod % (P/2 - a) == 0) FOR(b,1,P-a-1) {
int c = P - a - b;
if (c < 0 || c > P) continue;
long long p = P / 2;
if (S * (long long) S / 4 != p * (p-a) * (p-b) * (p-c)) continue;
int ia = lower_bound(all.begin(), all.end(), make_pair(a, make_pair(0, 0))) - all.begin();
int ib = lower_bound(all.begin(), all.end(), make_pair(b, make_pair(0, 0))) - all.begin();
int saveib = ib;
while (all[ia].first == a) {
ib = saveib;
while (all[ib].first == b) {
int x = all[ia].second.first, y = all[ia].second.second, z = all[ib].second.first, t = all[ib].second.second;
REP(turn,2) {
REP(turn2,2) {
REP(turn1,2) {
if (check(x, y, z, t, c)) return ;
if (check(x, y, -z, t, c)) return ;
if (check(x, y, z, -t, c)) return ;
if (check(x, y, -z, -t, c)) return ;
swap(z, t);
}
swap(x, y);
}
swap(x, z);
swap(y, t);
}
++ib; if (ib == all.size()) break;
}
++ia; if (ia == all.size()) break;
}
}
cout << "Flag" << endl;
}
int main() {
ios :: sync_with_stdio(false); cin.tie(NULL);
cout << (fixed) << setprecision(6);
FOR(i,1,10000) FOR(j,i+1,10000) {
int cur = i*i + j*j;
int k = mysqrt(cur);
if (k*k == cur) all.push_back(make_pair(k, make_pair(i, j)));
}
FOR(i,1,10000) all.push_back(make_pair(i, make_pair(0, i)));
sort(all.begin(), all.end());
while (cin >> S >> P) {
if (S % 2 == 1) cout << "Flag" << endl;
else if (P % 2 == 1) cout << "Flag" << endl;
else if (S *(long long) S % (P/2)) cout << "Flag" << endl;
else solve();
}
return 0;
}
I2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxzdHJpbmc+CiNpbmNsdWRlIDx2ZWN0b3I+CiNpbmNsdWRlIDxjc3RkbGliPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPHNzdHJlYW0+CiNpbmNsdWRlIDxpb21hbmlwPgojaW5jbHVkZSA8Y29tcGxleD4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKI2luY2x1ZGUgPGN0aW1lPgojaW5jbHVkZSA8ZGVxdWU+CiNpbmNsdWRlIDxiaXRzZXQ+CiNpbmNsdWRlIDxjY3R5cGU+CiNpbmNsdWRlIDx1dGlsaXR5PgojaW5jbHVkZSA8Y2Fzc2VydD4KdXNpbmcgbmF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eiA9IGFsbFtpYl0uc2Vjb25kLmZpcnN0LCB0ID0gYWxsW2liXS5zZWNvbmQuc2Vjb25kOwogICAgICAgICAgICAgICAgUkVQKHR1cm4sMikgewogICAgICAgICAgICAgICAgICAgIFJFUCh0dXJuMiwyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIFJFUCh0dXJuMSwyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2soeCwgeSwgeiwgdCwgYykpIHJldHVybiA7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hlY2soeCwgeSwgLXosIHQsIGMpKSByZXR1cm4gOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrKHgsIHksIHosIC10LCBjKSkgcmV0dXJuIDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGVjayh4LCB5LCAteiwgLXQsIGMpKSByZXR1cm4gOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dhcCh6LCB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBzd2FwKHgsIHkpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBzd2FwKHgsIHopOwogICAgICAgICAgICAgICAgICAgIHN3YXAoeSwgdCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICArK2liOyBpZiAoaWIgPT0gYWxsLnNpemUoKSkgYnJlYWs7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgKytpYTsgaWYgKGlhID09IGFsbC5zaXplKCkpIGJyZWFrOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgIkZsYWciIDw8IGVuZGw7Cn0KCmludCBtYWluKCkgewogICAgaW9zIDo6IHN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7IGNpbi50aWUoTlVMTCk7CiAgICBjb3V0IDw8IChmaXhlZCkgPDwgc2V0cHJlY2lzaW9uKDYpOwogICAgRk9SKGksMSwxMDAwMCkgRk9SKGosaSsxLDEwMDAwKSB7CiAgICAgICAgaW50IGN1ciA9IGkqaSArIGoqajsKICAgICAgICBpbnQgayA9IG15c3FydChjdXIpOwogICAgICAgIGlmIChrKmsgPT0gY3VyKSBhbGwucHVzaF9iYWNrKG1ha2VfcGFpcihrLCBtYWtlX3BhaXIoaSwgaikpKTsKICAgIH0KICAgIEZPUihpLDEsMTAwMDApIGFsbC5wdXNoX2JhY2sobWFrZV9wYWlyKGksIG1ha2VfcGFpcigwLCBpKSkpOwogICAgc29ydChhbGwuYmVnaW4oKSwgYWxsLmVuZCgpKTsKICAgIHdoaWxlIChjaW4gPj4gUyA+PiBQKSB7CiAgICAgICAgaWYgKFMgJSAyID09IDEpIGNvdXQgPDwgIkZsYWciIDw8IGVuZGw7CiAgICAgICAgZWxzZSBpZiAoUCAlIDIgPT0gMSkgY291dCA8PCAiRmxhZyIgPDwgZW5kbDsKICAgICAgICBlbHNlIGlmIChTICoobG9uZyBsb25nKSBTICUgKFAvMikpIGNvdXQgPDwgIkZsYWciIDw8IGVuZGw7CiAgICAgICAgZWxzZSBzb2x2ZSgpOwogICAgfQogICAgcmV0dXJuIDA7Cn0KCg==