Happy Number
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Digits 2, 3 and 6 are happy, while all others are unhappy. An integer is happy if it contains only happy digits in its decimal notation. For example, 2, 3, 263 are happy numbers, while 231 is not.

Now Cuber QQ wants to know the n-th happy positive integer.

输入描述:

The first and only line of input contains a positive integer n ().

输出描述:

The first and only line of output contains the n-th happy positive integer.
示例1

输入

复制
680

输出

复制
326623