#include <iostream>
using namespace std;
void printSeq(int num, int a[], int opIndx,int s){
if(num <= 0){
for(int j=0;j<opIndx;j++)
cout<<a[j]<<",";
cout<<endl;
return;
}
a[opIndx] = 1;
printSeq(num-1, a, opIndx+1, 1);
}
int main(){
int a[5];
printSeq(5,a,0,1);
return 0;
}
ICNpbmNsdWRlIDxpb3N0cmVhbT4KIAogdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIAogdm9pZCBwcmludFNlcShpbnQgbnVtLCBpbnQgYVtdLCBpbnQgb3BJbmR4LGludCBzKXsKICAgICBpZihudW0gPD0gMCl7CiAgICAgICAgIGZvcihpbnQgaj0wO2o8b3BJbmR4O2orKykKICAgICAgICAgICAgIGNvdXQ8PGFbal08PCIsIjsKICAgICAgICAgY291dDw8ZW5kbDsKICAgICAgICAgcmV0dXJuOwogICAgIH0KIAogCiAgICAgYVtvcEluZHhdID0gMTsKICAgICBwcmludFNlcShudW0tMSwgYSwgb3BJbmR4KzEsIDEpOwogfQogCiBpbnQgbWFpbigpewogICAgIGludCBhWzVdOwogICAgIHByaW50U2VxKDUsYSwwLDEpOwogICAgIHJldHVybiAwOwogfQ==