/*
欧拉计划第24题, 0~9, 10个数字去排列字典序的第1000000个
*/
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int cnt = 0;
do{
cnt ++;
//cout << cnt;
if (cnt == 1)
{
for (int i = 0; i < 10; ++ i) cout << a[i];
cout << endl;
break;
}
}while(next_permutation(a, a + 10));
return 0;
}