#include <iostream>
#include <iomanip>
#include<cmath>
using namespace std;
int main()
{
/* double r;
double pi = 3.141592653;
cin >> r;
cout << fixed << setprecision(9) << (pi * r * r);
*/
// long long x;
// long long y;
// int a , b;
// cin >> x >> y;
// a = x % 10;
// b = y % 10;
// cout << a + b;
/* long long x, y, n;
cin >> n >> x >> y;
cout << n * (y - x) << endl;
*/
/*long long x, y;
cin >> x >> y;
cout << x / y;
*/
/* cout << fixed << setprecision(6);
double n, r;
double pi = 3.141592;
cin >> n >> r;
cout << fixed << setprecision(6) << (pi * r * r) - (n * n);
*/
/*double x, y;
cin >> x >> y;
long long ans = ceil(x / y);
cout << ans;
*/
/*long long n;
cin >> n;
cout << 0 << " " << 0;
*/
/*double a, b;
cin >> a >> b;
cout << "floor " << a << " / " << b << " = " << floor(a / b) << endl;
cout << "ceil " << a << " / " << b << " = " << ceil(a / b) << endl;
cout << "round " << a << " / " << b << " = " << round(a / b) << endl;
*/
/* long long n, sum;
cin >> n;
sum = (n * (n + 1)) / 2;
cout << sum; */
/* double a, b, c, x;
cin >> a >> b >> c;
x = ((2 * a) + (3 * b)) * (5 * c);
cout << fixed << setprecision(6) << x;
*/
/* long long n;
cin >> n;
cout << (n/2)+1;
*/
/* double r;
double pi = 3.141592;
cin >> r;
cout << fixed << setprecision(4) << (pi * r * r) + (0.5 * 2 * r * 1.732050 * r) - ((pi * r * r) / 6);
*/
/* long long n;
cin >> n;
cout << (n/50)+((n%50)/20)+((n%50)%20);
*/
/* long long n;
cin >> n;
cout << (n*(n+1)/2)-(n-1);
*/
/*string x, y;
cin >> x >> y;
cout << y << endl;
cout << x << endl;
*/
/*long long n;
cin >> n;
cout << n % 10;
*/
/*int n;
cin >> n;
cout << (n * 4) + 12;
*/
/*long long n, m, x;
cin >> n >> m;
x = (n / m)*m;
cout << x;
*/
/*int n;
cin >> n;
cout << n - 1;
*/
/*double a, b, d, x;
double pi = 3.141592;
cin >> a >> b;
d = sqrt(a / pi) * 2;
x = sqrt(2) * d;
cout << fixed << setprecision(6) << 0.25 * x * b;
*/
/*long long a, b, t;
cin >> a >> b >> t;
cout << (t / a) * b;
*/
/*long long n, a, b, c, d, e;
cin >> n;
a = n / 5;
b = (n % 5) / 4;
c = ((n % 5) % 4) / 3;
d = (((n % 5) % 4) % 3) / 2;
e = ((((n % 5) % 4) % 3) % 2) / 1;
cout << a + b + c + d + e;
*/
/*string x;
cin >> x;
cout << "Hello" << " " << x;
*/
/*long long x, y, z, c;
cin >> x >> y >> z;
c = (x * x) + (y * z);
cout << c;
*/
/*int x, y, temp;
cin >> x >> y;
temp = x;
x = y;
y = temp;
cout << x << " " << y;
*/
/*int x, y;
cin >> x >> y;
if (x > y || x == y) {
cout << "Yes";
}
else {
cout << "No";
}
*/
/*int a, b;
cin >> a >> b;
if(a%b==0 || b%a==0){
cout << "Multiples";
}
else {
cout << "No Multiples";
}
*/
/*long long a, b, c;
cin >> a >> b >> c;
long long minn = a;
if (b < minn)
minn = b;
if (c < minn)
minn = c;
cout << minn << " ";
long long maxx = a;
if (b > maxx)
maxx = b;
if (c > maxx)
maxx = c;
cout << maxx;
*/
/*string m, n, x, y;
cin >> m >> n;
cin >> x >> y;
if (n == y) {
cout << "ARE Brothers";
}
else {
cout << "NOT";
}
*/
/*char t;
cin >> t;
if (t >= '0' && t <= '9') {
cout << "IS DIGIT";
}
else {
cout << "ALPHA" << endl;
if (t >= 'A' && t <= 'Z') {
cout << "IS CAPITAL";
}
else{
cout << "IS SMALL";
}
}
*/
/*char c;
cin >> c;
if (c >= 'A' && c <= 'Z') {
cout << char(c + 32) ;
}
else if (c >= 'a' && c <= 'z') {
cout << char(c - 32);
}
*/
/*
long long a, b;
char s;
cin >> a >> s >> b;
if (s == '+') {
cout << a + b;
}
else if (s == '-') {
cout << a - b;
}
else if (s == '*') {
cout << a * b;
}
else if (s == '/') {
cout << a / b;
}
*/
/*int a;
cin >> a;
if (a > 999 && a <= 9999) {
if ((a / 1000) % 2 == 0) {
cout << "EVEN";
}
else {
cout << "ODD";
}
}
*/
/*double a, b;
cin >> a >> b;
if (a == 0 && b == 0) {
cout << "Origem";
}
else if (a != 0 && b == 0) {
cout << "Eixo X";
}
else if (a == 0 && b != 0) {
cout << "Eixo Y";
}
else if (a > 0 && b > 0) {
cout << "Q1";
}
else if (a < 0 && b > 0) {
cout << "Q2";
}
else if (a < 0 && b < 0) {
cout << "Q3";
}
else if (a > 0 && b < 0) {
cout << "Q4";
}
*/
/*int y, m, d, r;
cin >> d;
y = d / 365;
m = (d % 365) / 30;
r = (d % 365) % 30;
cout << y << " " << "years" << endl;
cout << m << " " << "months" << endl;
cout << r << " " << "days" << endl;
*/
/*double a;
cin >> a;
if (a >= 0 && a <= 25) {
cout << "Interval" << " " << "[0,25]";
}
else if (a > 25 && a <= 50) {
cout << "Interval" << " " << "(25,50]";
}
else if (a > 50 && a <= 75) {
cout << "Interval" << " " << "(50,75]";
}
else if (a > 75 && a <= 100) {
cout << "Interval" << " " << "(75,100]";
}
else {
cout << "Out of Intervals";
}
*/
/*long long a, b, c;
cin >> a >> b >> c;
if (a >= b && a >= c) {
if (b > c) {
cout << c << endl << b << endl << a << endl;
}
else {
cout << b << endl << c << endl << a << endl;
}
}
else if (b >= a && b >= c) {
if (a > c) {
cout << c << endl << a << endl << b << endl;
}
else {
cout << a << endl << c << endl << b << endl;
}
}
else if (c >= b && c >= a) {
if (b > a) {
cout << a << endl << b << endl << c << endl;
}
else {
cout << b << endl << a << endl << c << endl;
}
}
cout << endl << a << endl << b << endl << c << endl;
*/
/*double x;
int y;
cin >> x;
y = int(x);
if (x == y) {
cout << "int" << " " << x;
}
else if (x != y) {
cout << "float" << " " << y << " " << x - y;
}
*/
/*int a, b;
char c;
cin >> a >> c >> b;
if (c == '>') {
if (a > b) {
cout << "Right" << endl;
}
else {
cout << "Wrong" << endl;
}
}
if (c == '<') {
if (a < b) {
cout << "Right" << endl;
}
else {
cout << "Wrong" << endl;
}
}
if (c == '=') {
if (a == b) {
cout << "Right" << endl;
}
else {
cout << "Wrong" << endl;
}
}
*/
/*int a, b, c;
char s, r;
cin >> a >> s >> b >> r >> c ;
if (s == '+') {
if (a + b == c) {
cout << "Yes" << endl;
}
else {
cout << a + b;
}
}
else if (s == '-') {
if (a - b == c) {
cout << "Yes" << endl;
}
else {
cout << a - b;
}
}
else if (s == '*') {
if (a * b == c) {
cout << "Yes" << endl;
}
else {
cout << a * b;
}
}
*/
/* long long l1, r1, l2, r2;
cin >> l1 >> r1 >> l2 >> r2;
if (l1 <= l2 && r1 >= l2) {
if (r1 <= r2) {
cout << l2 << " " << r1;
}
else if (r2 <= r1) {
cout << l2 << " " << r2;
}
}
else if (l1 >= l2 && l1 <= r2) {
if (r1 >= r2) {
cout << l1 << " " << r2;
}
else if (l2 <= r2) {
cout << l1 << " " << r1;
}
}
else {
cout << -1;
}
*/
/* int x, y, z, l;
cin >> x >> y >> z >> l;
x = x % 100;
y = y % 100;
z = z % 100;
l = l % 100;
long long mul = x * y * z * l;
int n = mul % 100;
if (n < 10) {
cout << 0 << n;
}
else {
cout << n;
}
*/
/*double a, b;
cin >> a >> b;
double x = sqrt((a * a) + (b * b));
double pi = 3.14159;
double y = (0.25 * (x * x) * pi) * 0.5;
cout << fixed << setprecision(4) << y;
*/
/*int w;
cin >> w;
if (w > 2 && w % 2 == 0) {
cout << "YES" << endl;
}
else {
cout << "No" << endl;
}
*/
/* double n, k, a;
cin >> n >> k >> a;
double x;
x = (n * k) / a;
if (x <= 2147483647 && x >= -2147483648) {
if (x == (int)(x)) {
cout << "int" << endl;
}
else if (x != (int)(x)) {
cout << "double" << endl;
}
}
else if (x > 2147483647 || x < -2147483648) {
if (x == (long long)(x)){
cout << "long long" << endl;
}
else if (x != (long long)(x)){
cout << "double" << endl;
}
}
*/
/*int x, y;
cin >> x >> y;
if (x <= y + 5) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
*/
/*int n;
cin >> n;
if (n >= 95) {
cout << "A";
}
else if (n >= 85 && n < 95) {
cout << "A-";
}
else if (n >= 80 && n < 85) {
cout << "B";
}
else if (n >= 75 && n < 80) {
cout << "B-";
}
else if (n >= 70 && n < 75) {
cout << "C";
}
else if (n >= 65 && n < 70) {
cout << "C-";
}
else if (n >= 60 && n < 65) {
cout << "D";
}
else if (n >= 45 && n < 60) {
cout << "D-";
}
else if (n < 45) {
cout << "F";
}
*/
/*int x, y, z;
cin >> x >> y >> z;
cout << z << " " << x << " " << y;
*/
/*ng long x, y;
cin >> x >> y;
if(y > 0)
{
cout << x % y;
}
else {
cout << -1;
}
*/
/*long long n;
cin >> n;
cout << (n)-(n / 7);
*/
double n, z, a, b;
cin >> n >> z >> a >> b;
if (a <= n && b <= n) {
if (a != b) {
cout << (abs(a) - abs(b - z));
}
}
/* int n;
cin >> n;
if (n == 10){
cout << 0;
}
else {
cout << (n / 25) + ((n % 25) / 10) + (((n % 25) % 10) / 5) + ((((n % 25) % 10) % 5) / 1);
}
*/
/*long long a, b, c, d;
cin >> a >> b >> c >> d;
if (b*log(a) > d*log(c)) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
*/
return 0;
}
CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPGlvbWFuaXA+CiNpbmNsdWRlPGNtYXRoPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CgoKCgogICAgLyogZG91YmxlIHI7CiAgICAgZG91YmxlIHBpID0gMy4xNDE1OTI2NTM7CgogICAgIGNpbiA+PiByOwogICAgIGNvdXQgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uKDkpIDw8IChwaSAqIHIgKiByKTsKICAgICAqLwoKCgogICAgIC8vIGxvbmcgbG9uZyB4OwogICAgIC8vIGxvbmcgbG9uZyAgeTsKICAgICAvLyBpbnQgYSAsIGI7CiAgICAgLy8gY2luID4+IHggPj4geTsKICAgICAvLyBhID0geCAlIDEwOwogICAgIC8vIGIgPSB5ICUgMTA7CiAgICAgLy8gY291dCA8PCBhICsgYjsKCgoKICAgICAvKiBsb25nIGxvbmcgeCwgeSwgbjsKICAgICAgY2luID4+IG4gPj4geCA+PiB5OwogICAgICBjb3V0IDw8IG4gKiAoeSAtIHgpIDw8IGVuZGw7CiAgICAgICovCgogICAgICAvKmxvbmcgbG9uZyB4LCB5OwogICAgICBjaW4gPj4geCA+PiB5OwogICAgICBjb3V0IDw8IHggLyB5OwogICAgICAqLwoKICAgICAgLyogY291dCA8PCBmaXhlZCA8PCBzZXRwcmVjaXNpb24oNik7CiAgICAgICBkb3VibGUgbiwgcjsKICAgICAgIGRvdWJsZSBwaSA9IDMuMTQxNTkyOwoKICAgICAgIGNpbiA+PiBuID4+IHI7CiAgICAgICBjb3V0IDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbig2KSA8PCAocGkgKiByICogcikgLSAobiAqIG4pOwogICAgICAgKi8KCiAgICAgICAvKmRvdWJsZSB4LCB5OwogICAgICAgIGNpbiA+PiB4ID4+IHk7CiAgICAgICAgbG9uZyBsb25nIGFucyA9IGNlaWwoeCAvIHkpOwogICAgICAgIGNvdXQgPDwgYW5zOwogICAgICAgICovCiAgICAgICAgLypsb25nIGxvbmcgbjsKICAgICAgICBjaW4gPj4gbjsKICAgICAgICBjb3V0IDw8IDAgPDwgIiAiIDw8IDA7CiAgICAgICAgKi8KCiAgICAgICAgLypkb3VibGUgYSwgYjsKICAgICAgICBjaW4gPj4gYSA+PiBiOwogICAgICAgIGNvdXQgPDwgImZsb29yICIgPDwgYSA8PCAiIC8gIiA8PCBiIDw8ICIgPSAiIDw8IGZsb29yKGEgLyBiKSA8PCBlbmRsOwogICAgICAgIGNvdXQgPDwgImNlaWwgIiA8PCBhIDw8ICIgLyAiIDw8IGIgPDwgIiA9ICIgPDwgY2VpbChhIC8gYikgPDwgZW5kbDsKICAgICAgICBjb3V0IDw8ICJyb3VuZCAiIDw8IGEgPDwgIiAvICIgPDwgYiA8PCAiID0gIiA8PCByb3VuZChhIC8gYikgPDwgZW5kbDsKICAgICAgICAqLwoKICAgICAgICAvKiBsb25nIGxvbmcgbiwgc3VtOwogICAgICAgICBjaW4gPj4gbjsKICAgICAgICAgc3VtID0gKG4gKiAobiArIDEpKSAvIDI7CiAgICAgICAgIGNvdXQgPDwgc3VtOyAqLwoKICAgICAgICAgLyogZG91YmxlIGEsIGIsIGMsIHg7CiAgICAgICAgICBjaW4gPj4gYSA+PiBiID4+IGM7CiAgICAgICAgICB4ID0gKCgyICogYSkgKyAoMyAqIGIpKSAqICg1ICogYyk7CiAgICAgICAgICBjb3V0IDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbig2KSA8PCB4OwogICAgICAgICAgKi8KCgogICAgICAgICAgLyogbG9uZyBsb25nIG47CiAgICAgICAgICAgY2luID4+IG47CiAgICAgICAgICAgY291dCA8PCAobi8yKSsxOwogICAgICAgICAgICovCgoKICAgICAgICAgICAvKiBkb3VibGUgcjsKICAgICAgICAgICAgZG91YmxlIHBpID0gMy4xNDE1OTI7CgogICAgICAgICAgICBjaW4gPj4gcjsKCgogICAgICAgICAgICBjb3V0IDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbig0KSA8PCAocGkgKiByICogcikgKyAoMC41ICogMiAqIHIgKiAxLjczMjA1MCAqIHIpIC0gKChwaSAqIHIgKiByKSAvIDYpOwogICAgICAgICAgICAqLwoKCiAgICAgICAgICAgIC8qIGxvbmcgbG9uZyBuOwogICAgICAgICAgICAgY2luID4+IG47CgoKCiAgICAgICAgICAgICBjb3V0IDw8IChuLzUwKSsoKG4lNTApLzIwKSsoKG4lNTApJTIwKTsKCiAgICAgICAgICAgICAqLwoKICAgICAgICAgICAgIC8qIGxvbmcgbG9uZyBuOwogICAgICAgICAgICAgIGNpbiA+PiBuOwoKICAgICAgICAgICAgICBjb3V0IDw8IChuKihuKzEpLzIpLShuLTEpOwogICAgICAgICAgKi8KCgogICAgICAgICAgLypzdHJpbmcgeCwgeTsKICAgICAgICAgIGNpbiA+PiB4ID4+IHk7CiAgICAgICAgICBjb3V0IDw8IHkgPDwgZW5kbDsKICAgICAgICAgIGNvdXQgPDwgeCA8PCBlbmRsOwogICAgICAgICAgKi8KCiAgICAgICAgICAvKmxvbmcgbG9uZyBuOwogICAgICAgICAgICBjaW4gPj4gbjsKCiAgICAgICAgICAgIGNvdXQgPDwgbiAlIDEwOwogICAgICAgICAgICAqLwoKCgogICAgICAgICAgICAvKmludCBuOwogICAgICAgICAgICBjaW4gPj4gbjsKICAgICAgICAgICAgY291dCA8PCAobiAqIDQpICsgMTI7CiAgICAgICAgICAgICovCgoKICAgICAgICAgICAgLypsb25nIGxvbmcgbiwgbSwgeDsKICAgICAgICAgICAgY2luID4+IG4gPj4gbTsKICAgICAgICAgICAgeCA9IChuIC8gbSkqbTsKICAgICAgICAgICAgY291dCA8PCB4OwogICAgICAgICAgICAqLwoKCiAgICAgICAgICAgIC8qaW50IG47CiAgICAgICAgICAgIGNpbiA+PiBuOwogICAgICAgICAgICBjb3V0IDw8IG4gLSAxOwogICAgICAgICAgICAqLwoKCiAgICAgICAgICAgIC8qZG91YmxlIGEsIGIsIGQsIHg7CiAgICAgICAgICAgIGRvdWJsZSBwaSA9IDMuMTQxNTkyOwogICAgICAgICAgICBjaW4gPj4gYSA+PiBiOwogICAgICAgICAgICBkID0gc3FydChhIC8gcGkpICogMjsKICAgICAgICAgICAgeCA9IHNxcnQoMikgKiBkOwogICAgICAgICAgICBjb3V0IDw8IGZpeGVkIDw8IHNldHByZWNpc2lvbig2KSA8PCAwLjI1ICogeCAqIGI7CiAgICAgICAgICAgICovCgoKCiAgICAgICAgICAgIC8qbG9uZyBsb25nIGEsIGIsIHQ7CiAgICAgICAgICAgIGNpbiA+PiBhID4+IGIgPj4gdDsKICAgICAgICAgICAgY291dCA8PCAodCAvIGEpICogYjsKICAgICAgICAgICAgKi8KCgogICAgICAgICAgICAvKmxvbmcgbG9uZyBuLCBhLCBiLCBjLCBkLCBlOwogICAgICAgICAgICBjaW4gPj4gbjsKICAgICAgICAgICAgYSA9IG4gLyA1OwogICAgICAgICAgICBiID0gKG4gJSA1KSAvIDQ7CiAgICAgICAgICAgIGMgPSAoKG4gJSA1KSAlIDQpIC8gMzsKICAgICAgICAgICAgZCA9ICgoKG4gJSA1KSAlIDQpICUgMykgLyAyOwogICAgICAgICAgICBlID0gKCgoKG4gJSA1KSAlIDQpICUgMykgJSAyKSAvIDE7CiAgICAgICAgICAgIGNvdXQgPDwgYSArIGIgKyBjICsgZCArIGU7CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKnN0cmluZyB4OwogICAgICAgICAgICBjaW4gPj4geDsKICAgICAgICAgICAgY291dCA8PCAiSGVsbG8iIDw8ICIgIiA8PCB4OwogICAgICAgICAgICAqLwoKICAgICAgICAgICAgLypsb25nIGxvbmcgeCwgeSwgeiwgYzsKCiAgICAgICAgICAgIGNpbiA+PiB4ID4+IHkgPj4gejsKICAgICAgICAgICAgYyA9ICh4ICogeCkgKyAoeSAqIHopOwogICAgICAgICAgICBjb3V0IDw8IGM7CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKmludCB4LCB5LCB0ZW1wOwogICAgICAgICAgICBjaW4gPj4geCA+PiB5OwogICAgICAgICAgICB0ZW1wID0geDsKICAgICAgICAgICAgeCA9IHk7CiAgICAgICAgICAgIHkgPSB0ZW1wOwoKICAgICAgICAgICAgY291dCA8PCB4IDw8ICIgIiA8PCB5OwogICAgICAgICAgICAqLwoKICAgICAgICAgICAgLyppbnQgeCwgeTsKICAgICAgICAgICAgY2luID4+IHggPj4geTsKICAgICAgICAgICAgaWYgKHggPiB5IHx8IHggPT0geSkgewogICAgICAgICAgICAgICAgY291dCA8PCAiWWVzIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIk5vIjsKICAgICAgICAgICAgfQogICAgICAgICAgICAqLwoKCiAgICAgICAgICAgIC8qaW50IGEsIGI7CiAgICAgICAgICAgIGNpbiA+PiBhID4+IGI7CiAgICAgICAgICAgIGlmKGElYj09MCB8fCBiJWE9PTApewogICAgICAgICAgICAgICAgY291dCA8PCAiTXVsdGlwbGVzIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIk5vIE11bHRpcGxlcyI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgKi8KCgogICAgICAgICAgICAvKmxvbmcgbG9uZyBhLCBiLCBjOwogICAgICAgICAgICBjaW4gPj4gYSA+PiBiID4+IGM7CiAgICAgICAgICAgIGxvbmcgbG9uZyBtaW5uID0gYTsKICAgICAgICAgICAgaWYgKGIgPCBtaW5uKQogICAgICAgICAgICAgICAgbWlubiA9IGI7CgogICAgICAgICAgICBpZiAoYyA8IG1pbm4pCiAgICAgICAgICAgICAgICBtaW5uID0gYzsKCiAgICAgICAgICAgIGNvdXQgPDwgbWlubiA8PCAiICI7CgogICAgICAgICAgICBsb25nIGxvbmcgbWF4eCA9IGE7CiAgICAgICAgICAgIGlmIChiID4gbWF4eCkKICAgICAgICAgICAgICAgIG1heHggPSBiOwoKICAgICAgICAgICAgaWYgKGMgPiBtYXh4KQogICAgICAgICAgICAgICAgbWF4eCA9IGM7CgogICAgICAgICAgICBjb3V0IDw8IG1heHg7CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKnN0cmluZyBtLCBuLCB4LCB5OwogICAgICAgICAgICBjaW4gPj4gbSA+PiBuOwogICAgICAgICAgICBjaW4gPj4geCA+PiB5OwoKICAgICAgICAgICAgaWYgKG4gPT0geSkgewogICAgICAgICAgICAgICAgY291dCA8PCAiQVJFIEJyb3RoZXJzIjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJOT1QiOwogICAgICAgICAgICB9CiAgICAgICAgICAgICovCgoKICAgICAgICAgICAgLypjaGFyIHQ7CiAgICAgICAgICAgIGNpbiA+PiB0OwogICAgICAgICAgICBpZiAodCA+PSAnMCcgJiYgdCA8PSAnOScpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIklTIERJR0lUIjsKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJBTFBIQSIgPDwgZW5kbDsKCiAgICAgICAgICAgICAgICBpZiAodCA+PSAnQScgJiYgdCA8PSAnWicpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICJJUyBDQVBJVEFMIjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2V7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCAiSVMgU01BTEwiOwogICAgICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIH0KICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8qY2hhciBjOwogICAgICAgICAgICBjaW4gPj4gYzsKICAgICAgICAgICAgaWYgKGMgPj0gJ0EnICYmIGMgPD0gJ1onKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGNoYXIoYyArIDMyKSA7CgogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gJ2EnICYmIGMgPD0gJ3onKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGNoYXIoYyAtIDMyKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAqLwoKICAgICAgICAgICAgLyoKICAgICAgICAgICAgbG9uZyBsb25nIGEsIGI7CiAgICAgICAgICAgIGNoYXIgczsKICAgICAgICAgICAgY2luID4+IGEgPj4gcyA+PiBiOwogICAgICAgICAgICBpZiAocyA9PSAnKycpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgYSArIGI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAocyA9PSAnLScpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgYSAtIGI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAocyA9PSAnKicpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgYSAqIGI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAocyA9PSAnLycpIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgYSAvIGI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8qaW50IGE7CiAgICAgICAgICAgIGNpbiA+PiBhOwogICAgICAgICAgICBpZiAoYSA+IDk5OSAmJiBhIDw9IDk5OTkpIHsKICAgICAgICAgICAgICAgIGlmICgoYSAvIDEwMDApICUgMiA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCAiRVZFTiI7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICJPREQiOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKmRvdWJsZSBhLCBiOwogICAgICAgICAgICBjaW4gPj4gYSA+PiBiOwogICAgICAgICAgICBpZiAoYSA9PSAwICYmIGIgPT0gMCkgewogICAgICAgICAgICAgICAgY291dCA8PCAiT3JpZ2VtIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChhICE9IDAgJiYgYiA9PSAwKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJFaXhvIFgiOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGEgPT0gMCAmJiBiICE9IDApIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIkVpeG8gWSI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoYSA+IDAgJiYgYiA+IDApIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIlExIjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZWxzZSBpZiAoYSA8IDAgJiYgYiA+IDApIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIlEyIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChhIDwgMCAmJiBiIDwgMCkgewogICAgICAgICAgICAgICAgY291dCA8PCAiUTMiOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGEgPiAwICYmIGIgPCAwKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJRNCI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8qaW50IHksIG0sIGQsIHI7CiAgICAgICAgICAgIGNpbiA+PiBkOwogICAgICAgICAgICB5ID0gZCAvIDM2NTsKICAgICAgICAgICAgbSA9IChkICUgMzY1KSAvIDMwOwogICAgICAgICAgICByID0gKGQgJSAzNjUpICUgMzA7CiAgICAgICAgICAgIGNvdXQgPDwgeSA8PCAiICIgPDwgInllYXJzIiA8PCBlbmRsOwogICAgICAgICAgICBjb3V0IDw8IG0gPDwgIiAiIDw8ICJtb250aHMiIDw8IGVuZGw7CiAgICAgICAgICAgIGNvdXQgPDwgciA8PCAiICIgPDwgImRheXMiIDw8IGVuZGw7CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKmRvdWJsZSBhOwogICAgICAgICAgICBjaW4gPj4gYTsKICAgICAgICAgICAgaWYgKGEgPj0gMCAmJiBhIDw9IDI1KSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJJbnRlcnZhbCIgPDwgIiAiIDw8ICJbMCwyNV0iOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGVsc2UgaWYgKGEgPiAyNSAmJiBhIDw9IDUwKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJJbnRlcnZhbCIgPDwgIiAiIDw8ICIoMjUsNTBdIjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIGlmIChhID4gNTAgJiYgYSA8PSA3NSkgewogICAgICAgICAgICAgICAgY291dCA8PCAiSW50ZXJ2YWwiIDw8ICIgIiA8PCAiKDUwLDc1XSI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSBpZiAoYSA+IDc1ICYmIGEgPD0gMTAwKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJJbnRlcnZhbCIgPDwgIiAiIDw8ICIoNzUsMTAwXSI7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJPdXQgb2YgSW50ZXJ2YWxzIjsKICAgICAgICAgICAgfQogICAgICAgICAgICAqLwoKICAgICAgICAgICAgLypsb25nIGxvbmcgYSwgYiwgYzsKICAgICAgICAgICAgY2luID4+IGEgPj4gYiA+PiBjOwoKICAgICAgICAgICAgaWYgKGEgPj0gYiAmJiBhID49IGMpIHsKICAgICAgICAgICAgICAgIGlmIChiID4gYykgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgYyA8PCBlbmRsIDw8IGIgPDwgZW5kbCA8PCBhIDw8IGVuZGw7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGIgPDwgZW5kbCA8PCBjIDw8IGVuZGwgPDwgYSA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBlbHNlIGlmIChiID49IGEgJiYgYiA+PSBjKSB7CiAgICAgICAgICAgICAgICBpZiAoYSA+IGMpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGMgPDwgZW5kbCA8PCBhIDw8IGVuZGwgPDwgYiA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCBhIDw8IGVuZGwgPDwgYyA8PCBlbmRsIDw8IGIgPDwgZW5kbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPj0gYiAmJiBjID49IGEpIHsKICAgICAgICAgICAgICAgIGlmIChiID4gYSkgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgYSA8PCBlbmRsIDw8IGIgPDwgZW5kbCA8PCBjIDw8IGVuZGw7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGIgPDwgZW5kbCA8PCBhIDw8IGVuZGwgPDwgYyA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGNvdXQgPDwgZW5kbCA8PCBhIDw8IGVuZGwgPDwgYiA8PCBlbmRsIDw8IGMgPDwgZW5kbDsKICAgICAgICAgICAgKi8KCiAgICAgICAgICAgIC8qZG91YmxlIHg7CiAgICAgICAgICAgIGludCB5OwogICAgICAgICAgICBjaW4gPj4geDsKICAgICAgICAgICAgeSA9IGludCh4KTsKICAgICAgICAgICAgaWYgKHggPT0geSkgewogICAgICAgICAgICAgICAgY291dCA8PCAiaW50IiA8PCAiICIgPDwgeDsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZWxzZSBpZiAoeCAhPSB5KSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8ICJmbG9hdCIgPDwgIiAiIDw8IHkgPDwgIiAiIDw8IHggLSB5OwogICAgICAgICAgICB9CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKmludCBhLCBiOwogICAgICAgICAgICBjaGFyIGM7CiAgICAgICAgICAgIGNpbiA+PiBhID4+IGMgPj4gYjsKICAgICAgICAgICAgaWYgKGMgPT0gJz4nKSB7CiAgICAgICAgICAgICAgICBpZiAoYSA+IGIpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICJSaWdodCIgPDwgZW5kbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgIldyb25nIiA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQoKICAgICAgICAgICAgaWYgKGMgPT0gJzwnKSB7CiAgICAgICAgICAgICAgICBpZiAoYSA8IGIpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICJSaWdodCIgPDwgZW5kbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgIldyb25nIiA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQoKCiAgICAgICAgICAgIGlmIChjID09ICc9JykgewogICAgICAgICAgICAgICAgaWYgKGEgPT0gYikgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgIlJpZ2h0IiA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCAiV3JvbmciIDw8IGVuZGw7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9CiAgICAgICAgICAgICovCgogICAgICAgICAgICAvKmludCBhLCBiLCBjOwogICAgICAgICAgICBjaGFyIHMsIHI7CiAgICAgICAgICAgIGNpbiA+PiBhID4+IHMgPj4gYiA+PiByID4+IGMgOwogICAgICAgICAgICBpZiAocyA9PSAnKycpIHsKICAgICAgICAgICAgICAgIGlmIChhICsgYiA9PSBjKSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCAiWWVzIiA8PCBlbmRsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCBhICsgYjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGVsc2UgaWYgKHMgPT0gJy0nKSB7CiAgICAgICAgICAgICAgICBpZiAoYSAtIGIgPT0gYykgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgIlllcyIgPDwgZW5kbDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgYSAtIGI7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9CgogICAgICAgICAgICBlbHNlIGlmIChzID09ICcqJykgewogICAgICAgICAgICAgICAgaWYgKGEgKiBiID09IGMpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8ICJZZXMiIDw8IGVuZGw7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGEgKiBiOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgfQogICAgICAgICAgICAqLwoKCiAgICAgICAgICAgIC8qIGxvbmcgbG9uZyBsMSwgcjEsIGwyLCByMjsKICAgICAgICAgICAgY2luID4+IGwxID4+IHIxID4+IGwyID4+IHIyOwogICAgICAgICAgICBpZiAobDEgPD0gbDIgJiYgcjEgPj0gbDIpIHsKICAgICAgICAgICAgICAgIGlmIChyMSA8PSByMikgewogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgbDIgPDwgIiAiIDw8IHIxOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZWxzZSBpZiAocjIgPD0gcjEpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGwyIDw8ICIgIiA8PCByMjsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGVsc2UgaWYgKGwxID49IGwyICYmIGwxIDw9IHIyKSB7CiAgICAgICAgICAgICAgICBpZiAocjEgPj0gcjIpIHsKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGwxIDw8ICIgIiA8PCByMjsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGVsc2UgaWYgKGwyIDw9IHIyKSB7CiAgICAgICAgICAgICAgICAgICAgY291dCA8PCBsMSA8PCAiICIgPDwgcjE7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICB9CgogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIGNvdXQgPDwgLTE7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgKi8KCgogICAgICAgICAgICAvKiBpbnQgeCwgeSwgeiwgbDsKICAgICAgICAgICAgIGNpbiA+PiB4ID4+IHkgPj4geiA+PiBsOwogICAgICAgICAgICAgeCA9IHggJSAxMDA7CiAgICAgICAgICAgICB5ID0geSAlIDEwMDsKICAgICAgICAgICAgIHogPSB6ICUgMTAwOwogICAgICAgICAgICAgbCA9IGwgJSAxMDA7CiAgICAgICAgICAgICBsb25nIGxvbmcgbXVsID0geCAqIHkgKiB6ICogbDsKICAgICAgICAgICAgIGludCBuID0gbXVsICUgMTAwOwogICAgICAgICAgICAgaWYgKG4gPCAxMCkgewogICAgICAgICAgICAgICAgIGNvdXQgPDwgMCA8PCBuOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgY291dCA8PCBuOwogICAgICAgICAgICAgfQogICAgICAgICAqLwoKICAgICAgICAgLypkb3VibGUgYSwgYjsKICAgICAgICAgY2luID4+IGEgPj4gYjsKICAgICAgICAgZG91YmxlIHggPSBzcXJ0KChhICogYSkgKyAoYiAqIGIpKTsKICAgICAgICAgZG91YmxlIHBpID0gMy4xNDE1OTsKICAgICAgICAgZG91YmxlIHkgPSAoMC4yNSAqICh4ICogeCkgKiBwaSkgKiAwLjU7CiAgICAgICAgIGNvdXQgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uKDQpIDw8IHk7CiAgICAgICAgICovCgogICAgICAgICAvKmludCB3OwogICAgICAgICBjaW4gPj4gdzsKICAgICAgICAgaWYgKHcgPiAyICYmIHcgJSAyID09IDApIHsKICAgICAgICAgICAgIGNvdXQgPDwgIllFUyIgPDwgZW5kbDsKICAgICAgICAgfQoKICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICBjb3V0IDw8ICJObyIgPDwgZW5kbDsKICAgICAgICAgfQogICAgICAgICAqLwoKICAgICAgIC8qIGRvdWJsZSBuLCBrLCBhOwogICAgICAgICBjaW4gPj4gbiA+PiBrID4+IGE7CgogICAgICAgICBkb3VibGUgeDsKICAgICAgICAgeCA9IChuICogaykgLyBhOwoKICAgICAgICAgaWYgKHggPD0gMjE0NzQ4MzY0NyAmJiB4ID49IC0yMTQ3NDgzNjQ4KSB7CiAgICAgICAgICAgICBpZiAoeCA9PSAoaW50KSh4KSkgewogICAgICAgICAgICAgICAgIGNvdXQgPDwgImludCIgPDwgZW5kbDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGVsc2UgaWYgKHggIT0gKGludCkoeCkpIHsKICAgICAgICAgICAgICAgICBjb3V0IDw8ICJkb3VibGUiIDw8IGVuZGw7CiAgICAgICAgICAgICB9CgogICAgICAgICB9CgoKICAgICAgICAgZWxzZSBpZiAoeCA+IDIxNDc0ODM2NDcgfHwgeCA8IC0yMTQ3NDgzNjQ4KSB7CgoKICAgICAgICAgICAgIGlmICh4ID09IChsb25nIGxvbmcpKHgpKXsKCiAgICAgICAgICAgICAgICAgY291dCA8PCAibG9uZyBsb25nIiA8PCBlbmRsOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZWxzZSBpZiAoeCAhPSAobG9uZyBsb25nKSh4KSl7CiAgICAgICAgICAgICAgICAgY291dCA8PCAiZG91YmxlIiA8PCBlbmRsOwogICAgICAgICAgICAgfQoKICAgICAgICAgfQogICAgICovCgoKICAgICAgICAgLyppbnQgeCwgeTsKICAgICAgICAgY2luID4+IHggPj4geTsKICAgICAgICAgaWYgKHggPD0geSArIDUpIHsKICAgICAgICAgICAgIGNvdXQgPDwgIlllcyIgPDwgZW5kbDsKICAgICAgICAgfQogICAgICAgICBlbHNlIHsKICAgICAgICAgICAgIGNvdXQgPDwgIk5vIiA8PCBlbmRsOwogICAgICAgICB9CiAgICAgICAgICovCgoKICAgICAgICAgLyppbnQgbjsKICAgICAgICAgY2luID4+IG47CiAgICAgICAgIGlmIChuID49IDk1KSB7CiAgICAgICAgICAgICBjb3V0IDw8ICJBIjsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlmIChuID49IDg1ICYmIG4gPCA5NSkgewogICAgICAgICAgICAgY291dCA8PCAiQS0iOwogICAgICAgICB9CiAgICAgICAgIGVsc2UgaWYgKG4gPj0gODAgJiYgbiA8IDg1KSB7CiAgICAgICAgICAgICBjb3V0IDw8ICJCIjsKICAgICAgICAgfQoKICAgICAgICAgZWxzZSBpZiAobiA+PSA3NSAmJiBuIDwgODApIHsKICAgICAgICAgICAgIGNvdXQgPDwgIkItIjsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlmIChuID49IDcwICYmIG4gPCA3NSkgewogICAgICAgICAgICAgY291dCA8PCAiQyI7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSBpZiAobiA+PSA2NSAmJiBuIDwgNzApIHsKICAgICAgICAgICAgIGNvdXQgPDwgIkMtIjsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlmIChuID49IDYwICYmIG4gPCA2NSkgewogICAgICAgICAgICAgY291dCA8PCAiRCI7CiAgICAgICAgIH0KICAgICAgICAgZWxzZSBpZiAobiA+PSA0NSAmJiBuIDwgNjApIHsKICAgICAgICAgICAgIGNvdXQgPDwgIkQtIjsKICAgICAgICAgfQogICAgICAgICBlbHNlIGlmIChuIDwgNDUpIHsKICAgICAgICAgICAgIGNvdXQgPDwgIkYiOwogICAgICAgICB9CiAgICAgICAgICovCgoKICAgICAgICAgLyppbnQgeCwgeSwgejsKICAgICAgICAgY2luID4+IHggPj4geSA+PiB6OwogICAgICAgICBjb3V0IDw8IHogPDwgIiAiIDw8IHggPDwgIiAiIDw8IHk7CiAgICAgICAgICovCgoKICAgICAgICAgLypuZyBsb25nIHgsIHk7CiAgICAgICAgIGNpbiA+PiB4ID4+IHk7CiAgICAgICAgIGlmKHkgPiAwKQogICAgICAgICB7CgoKICAgICAgICAgICAgIGNvdXQgPDwgeCAlIHk7CgogICAgICAgICB9CiAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgY291dCA8PCAtMTsKICAgICAgICAgfQogICAgICAgICAqLwoKICAgICAgICAgLypsb25nIGxvbmcgbjsKICAgICAgICAgY2luID4+IG47CiAgICAgICAgIGNvdXQgPDwgKG4pLShuIC8gNyk7CiAgICAgICAgICovCgogICAgICAgICBkb3VibGUgbiwgeiwgYSwgYjsKICAgICAgICAgY2luID4+IG4gPj4geiA+PiBhID4+IGI7CiAgICAgICAgIGlmIChhIDw9IG4gJiYgYiA8PSBuKSB7CiAgICAgICAgICAgICBpZiAoYSAhPSBiKSB7CiAgICAgICAgICAgICAgICAgY291dCA8PCAoYWJzKGEpIC0gYWJzKGIgLSB6KSk7CgogICAgICAgICAgICAgfQogICAgICAgICB9CgoKICAvKiBpbnQgbjsKICAgIGNpbiA+PiBuOwogICAgaWYgKG4gPT0gMTApewogICAgICAgIGNvdXQgPDwgMDsKfQoKICAgIGVsc2UgewogICAgICAgIGNvdXQgPDwgKG4gLyAyNSkgKyAoKG4gJSAyNSkgLyAxMCkgKyAoKChuICUgMjUpICUgMTApIC8gNSkgKyAoKCgobiAlIDI1KSAlIDEwKSAlIDUpIC8gMSk7CiAgICB9CiAgICAqLwogICAgCi8qbG9uZyBsb25nIGEsIGIsIGMsIGQ7CmNpbiA+PiBhID4+IGIgPj4gYyA+PiBkOwppZiAoYipsb2coYSkgPiBkKmxvZyhjKSkgewogICAgY291dCA8PCAiWUVTIiA8PCBlbmRsOwp9CmVsc2UgewogICAgY291dCA8PCAiTk8iIDw8IGVuZGw7Cn0KKi8KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgogICAgcmV0dXJuIDA7Cn0KCg==