#include <iostream>
#include <vector>
using namespace std;
void gen(vector<int> cur_, int N){
if(cur_.size() == N){
for(auto &i: cur_)
cout << i << " ";
cout << "\n";
return;
}
vector<int> tCur_ = cur_;
cur_.push_back(0);
tCur_.push_back(1);
gen(cur_, N);
gen(tCur_, N);
void solve(){
int n;
cin >> n;
gen({}, n);
int main(){
solve();
#include <iostream>
#include <vector>
using namespace std;
void gen(vector<int> cur_, int N){
if(cur_.size() == N){
for(auto &i: cur_)
cout << i << " ";
cout << "\n";
return;
}
vector<int> tCur_ = cur_;
cur_.push_back(0);
tCur_.push_back(1);
gen(cur_, N);
gen(tCur_, N);
}
void solve(){
int n;
cin >> n;
gen({}, n);
}
int main(){
solve();
}