# CFR 248 B. Chilly Willy ( Periodic, Observation )

Problem - 248B - Codeforces

1 ≤ n ≤ 1e5

O( 1 )

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

#define int long long

int get_len( int x ){
int res = 0;
while( x ){
++res;
x /= 10;
}
return res;
}

signed main(){
ios::sync_with_stdio( 0 );
int len; cin >> len;
if( len < 3 ) cout << -1 << endl;
else{
int z = 3;
for( int i = 1; ; ++i ){
if( get_len( i * 210 ) == z ){
cout << z << " " << i * 210 << endl;
++z;
}
if( z == 15 ) break;
}
}
cout << endl;
return 0;
}

3 210
4 1050
5 10080
6 100170
7 1000020
8 10000200
9 100000110
10 1000000050
11 10000000080
12 100000000170
*/

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

signed main(){
ios::sync_with_stdio( 0 );
int len; cin >> len;
if( len < 3 ) cout << -1 << endl;
else if( len == 3 ) cout << 210 << endl;
else{
int f = ( len - 4 ) % 6;
if( f <= 3 and f != 2 ){
cout << 1;
for( int i = 1; i < len - 2; ++i ){
cout << 0;
}
if( f == 0 ) cout << 50 << endl;
else if( f == 1 ) cout << 80 << endl;
else if( f == 3 ) cout << 20 << endl;
} else{
cout << 1;
for( int i = 1; i < len - 3; ++i ){
cout << 0;
}
if( f == 2 ) cout << 170 << endl;
else if( f == 4 ) cout << 200 << endl;
else cout << 110 << endl;
}
}
return 0;
```