#include <iostream>
using namespace std;
int main()
{
string s("hello, world");
string head("hello");
string tail("ld");
bool startwith = s.compare(0, head.size(), head) == 0;
cout << boolalpha << startwith << endl;
bool endwith = s.compare(s.size() - tail.size(), tail.size(), tail) == 0;
cout << boolalpha << endwith << endl;
}