#include <iostream>
#include <string>
using namespace std;

void subs(string sub, string ans) {
    // Base case: if the string is empty, print the answer
    if (sub.length() == 0) {
        cout << ans << endl; 
        return;
    }

    char ch = sub[0];             // Extract the first character
    string ros = sub.substr(1);   // The Rest Of String (ros)

    // Recursive call 1: Do not include the character in the answer
    subs(ros, ans);
    
    // Recursive call 2: Include the character in the answer
    subs(ros, ans + ch);
}

int main() {
    string s = "abc";

    // Call the function directly
    subs(s, "");
    
    return 0;
}