/*
* Description: Generate all subsets of a set in Java.
*
* Author : Adrian Statescu
*
* License : MIT
*/
import java.util.Scanner;
import java.io.*;
public class Main {
public static int pow(int a, int b) {
int r = 1;
for(int i = 1; i <= b; ++i) {
r = r * a;
}
return r;
}
public static void generate_all_subsets(int n) {
int total = pow(2, n);
for(int i = 1; i < total; ++i) {
for(int j = 0; j < n; ++j ) {
if((i
& (1<<j
))!=0) System.
out.
printf("%d ",
(j
+1));
}
}
}
public static void main
(String[] args
) {
Scanner scanner
= new Scanner
(System.
in);
int n = scanner.nextInt();
scanner.close();
generate_all_subsets( n );
}
}
LyoKICogRGVzY3JpcHRpb246IEdlbmVyYXRlIGFsbCBzdWJzZXRzIG9mIGEgc2V0IGluIEphdmEuCiAqIAogKiBBdXRob3IgICAgIDogQWRyaWFuIFN0YXRlc2N1CiAqCiAqIExpY2Vuc2UgICAgOiBNSVQKICovCgppbXBvcnQgamF2YS51dGlsLlNjYW5uZXI7CmltcG9ydCBqYXZhLmlvLio7CiAKcHVibGljIGNsYXNzIE1haW4gewogCgkgICAgcHVibGljIHN0YXRpYyBpbnQgcG93KGludCBhLCBpbnQgYikgewogCgkgICAgCSAgIGludCByID0gMTsKIAoJICAgIAkgICBmb3IoaW50IGkgPSAxOyBpIDw9IGI7ICsraSkgewogCiAgICAgICAgICAgICAgICAgICByID0gciAqIGE7CgkgICAgCSAgIH0KIAoJICAgIAkgICByZXR1cm4gcjsKCSAgICB9CiAKCSAgICBwdWJsaWMgc3RhdGljIHZvaWQgZ2VuZXJhdGVfYWxsX3N1YnNldHMoaW50IG4pIHsKIAogICAgICAgICAgICAgICBpbnQgdG90YWwgPSBwb3coMiwgbik7ICAgICAgICAgICAgICAgCiAKICAgICAgICAgICAgICAgZm9yKGludCBpID0gMTsgaSA8IHRvdGFsOyArK2kpIHsKIAogICAgICAgICAgICAgICAJICAgZm9yKGludCBqID0gMDsgaiA8IG47ICsraiApIHsgICAgICAgICAgICAgICAgICAgICAgIAogCiAgICAgICAgICAgICAgICAgICAgICAgaWYoKGkgJiAoMTw8aikpIT0wKSBTeXN0ZW0ub3V0LnByaW50ZigiJWQgIiwgKGorMSkpOyAgICAgIAogCiAgICAgICAgICAgICAgIAkgICB9IAogICAgICAgICAgICAgICAJICAgCiAgICAgICAgICAgICAgIAkgICBTeXN0ZW0ub3V0LnByaW50bG4oIiIpOyAKIAogICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAKICAgICAgICB9CiAKIAogICAgICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogCiAgICAgICAgICAgICAgICAgICAgU2Nhbm5lciBzY2FubmVyID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICBpbnQgbiA9IHNjYW5uZXIubmV4dEludCgpOwogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgIHNjYW5uZXIuY2xvc2UoKTsKICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVfYWxsX3N1YnNldHMoIG4gKTsJICAgICAgICAgICAgICAgICAgICAKIAogICAgICAgIAogICAgICAgfQp9ICAgICAgIA==