#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include using namespace std; using i32 = int_fast32_t; using i64 = int_fast64_t; using usize = uint_fast64_t; #define rep(i, n) for (usize i = 0; i < (usize)(n); i++) #define all(a) (a).begin(),(a).end() #define rall(a) (a).rbegin(),(a).rend() using P = pair; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); string s = "142857"; i64 n; cin >> n; if(n <= 6){ if(n == 0){ cout << 0 << endl; return 0; } cout << "0." << s.substr(0,n) << endl; }else{ i64 p = n % 6; i64 q = n / 6; string ans; rep(i,q){ ans = ans + s; } if(p != 0)ans = ans + s.substr(0,p); cout << ans << endl; } }