#include <iostream>
using namespace std;

int main() {
	// your code goes here
	string str = "apple";
	int n = str.length();
	for(int i=0;i<n;i++){
	string subst = "";
	for(int j=i;j<n;j++){
		 subst +=str[j];
		//Do any operation here , push check for some condition etc
		// result.push_back(substr);
		cout<<subst<<endl; //not printing why?
	}
}
return 0;
}

