#include <bits/stdc++.h>
using namespace std;

vector <string> Get_Stair_Path(int n){
    if(n <= 0){
            vector <string> bres;

            if(n == 0){
                bres.push_back("");
            }

            return bres;
        }
    
        vector <string> rres1 = Get_Stair_Path(n - 1);
        vector <string> rres2 = Get_Stair_Path(n - 2);
        vector <string> rres3 = Get_Stair_Path(n - 3);
        vector <string> mres;

        for(string rstr: rres1){
            mres.push_back('1' + rstr);
        }

        for(string rstr: rres2){
            mres.push_back('2' + rstr);
        }

        for(string rstr: rres3){
            mres.push_back('3' + rstr);
        }
        return mres;
}

int main(){
    int n;
    cin>>n;
    vector <string> paths = Get_Stair_Path(n);
    int count = 0;
    cout<<"[";
    for (string str : paths)
    {
        /* code */
        if(count != paths.size() - 1)
        cout<<str<<", ";
        else 
        cout<<str;
        count++;
    }
    cout<<"]";
    return 0;
}