#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int q, begin1, end1, begin2, end2;
getline(cin, s);
cin >> q;
while (q--) {
cin >> begin1 >> end1 >> begin2 >> end2;
end1 -= --begin1;
end2 -= --begin2;
cout << (s.substr(begin1, end1) == s.substr(begin2, end2) ? '+' : '-');
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglzdHJpbmcgczsKCWludCBxLCBiZWdpbjEsIGVuZDEsIGJlZ2luMiwgZW5kMjsKCWdldGxpbmUoY2luLCBzKTsKCWNpbiA+PiBxOwoJd2hpbGUgKHEtLSkgewoJCWNpbiA+PiBiZWdpbjEgPj4gZW5kMSA+PiBiZWdpbjIgPj4gZW5kMjsKCQllbmQxIC09IC0tYmVnaW4xOwoJCWVuZDIgLT0gLS1iZWdpbjI7CgkJY291dCA8PCAocy5zdWJzdHIoYmVnaW4xLCBlbmQxKSA9PSBzLnN1YnN0cihiZWdpbjIsIGVuZDIpID8gJysnIDogJy0nKTsgCgl9CglyZXR1cm4gMDsKfQ==