#include <stdio.h>
//因为是2x+1或者2x+2,所以22娘扭蛋的结果是奇数,33娘扭蛋的结果是偶数;
/*
2x + 1 = n, x = (n - 1) / 2,上一步为奇数
2x + 2 = n, x = (n - 2) / 2,上一步为偶数
*/
int main() {
    int n, k = 0;
    int arr[100] = {0};
    scanf("%d", &n);
    while (n > 0) {
        if (n % 2 == 0) { //偶数
            arr[k++] = 3;
            n = (n - 2) / 2;
        }

        else {
            arr[k++] = 2;  //奇数
            n = (n - 1) / 2;
        }
    }
    for (int i = k - 1; i >= 0; i--)
        printf("%c", arr[i] + '0');

}