#include <cstdio>
#include <iostream>
#include <functional>
using namespace std;
double qax(int a, long b) { return a * b; }
double quux(int a, long b) { return a * b; }
std::function<double(int, long)> gfred1 = qax;
std::function<double(int, long)> gfred0 = quux;
int main() {
fprintf(stdout, "%d\n", gfred1.target<double(*)(int, long)>() == gfred0.target<double(*)(int, long)>());
fprintf(stdout, "%d\n", *gfred1.target<double(*)(int, long)>() == qax);
fprintf(stdout, "%d\n", *gfred0.target<double(*)(int, long)>() == qax);
fprintf(stdout, "%d\n", *gfred0.target<double(*)(int, long)>() == quux);
fprintf(stdout, "%d\n", *gfred1.target<double(*)(int, long)>() == quux);
fprintf(stdout, "%d\n", *gfred1.target<double(*)(int, long)>() != quux);
fprintf(stdout, "%d\n", *gfred1.target<double(*)(int, long)>() != qax);
fprintf(stdout, "%d\n", *gfred0.target<double(*)(int, long)>() != qax);
fprintf(stdout, "%d\n", *gfred0.target<double(*)(int, long)>() != quux);
return 0;
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIApkb3VibGUgcWF4KGludCBhLCBsb25nIGIpIHsgcmV0dXJuIGEgKiBiOyB9CmRvdWJsZSBxdXV4KGludCBhLCBsb25nIGIpIHsgcmV0dXJuIGEgKiBiOyB9CnN0ZDo6ZnVuY3Rpb248ZG91YmxlKGludCwgbG9uZyk+IGdmcmVkMSA9IHFheDsgCnN0ZDo6ZnVuY3Rpb248ZG91YmxlKGludCwgbG9uZyk+IGdmcmVkMCA9IHF1dXg7IAoKaW50IG1haW4oKSB7CiAgZnByaW50ZihzdGRvdXQsICIlZFxuIiwgZ2ZyZWQxLnRhcmdldDxkb3VibGUoKikoaW50LCBsb25nKT4oKSA9PSBnZnJlZDAudGFyZ2V0PGRvdWJsZSgqKShpbnQsIGxvbmcpPigpKTsKICBmcHJpbnRmKHN0ZG91dCwgIiVkXG4iLCAqZ2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