#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int min(int a, int b) {
	return a < b ? a : b;
}

int main() {
    int n;
    scanf("%d", &n);
    
    if (n < 1) {
    	return 0;
    }

    char** words = (char**)malloc(n * sizeof(char*));
    
    words[0] = "1";
    int wordLength = 1;
    int wordsWithCurrentLengthCount = 1;
    int i = 1;
    
    while (i < n) {
    	int prevLengthStartIndex = i - wordsWithCurrentLengthCount;
    	
    	wordLength++;
    	wordsWithCurrentLengthCount = 2 * wordsWithCurrentLengthCount + 1;
    	
    	char* word = (char*)malloc((wordLength + 1) * sizeof(char));
    	word[0] = '0';
    	strcpy(&word[1], words[prevLengthStartIndex]);
    	words[i++] = word;
    	
    	int leftToGenerate = n - i;
    	int amount = min(leftToGenerate, wordsWithCurrentLengthCount - 1);
    	for (int j = 0; j < amount; j++) {
    		word = (char*)malloc((wordLength + 1) * sizeof(char));
	    	strcpy(word, words[prevLengthStartIndex + j / 2]);
	    	word[wordLength - 1] = j % 2 ? '1' : '0';
	    	word[wordLength] = '\0';
	    	words[i++] = word;
    	}
    }
    
    for (int i = 0; i < n; i++) {
    	printf("%4d. %s\n", i + 1, words[i]);
    }
    
    for (int i = 1; i < n; i++) {
    	free(words[i]);
    }
    free(words);
}
