#include <bits/stdc++.h>

using namespace std;

class custom_hash_t
{
    inline static uint64_t xor_shift( const uint64_t x, const int k )
    {
        return x ^ ( x >> k );
    }

    inline static uint64_t xor_shift_multiply( const uint64_t x, const int k, const uint64_t y )
    {
        return xor_shift( x, k ) * y;
    }

    inline static uint64_t splitmix64( uint64_t x )
    {
        /// http://x...content-available-to-author-only...i.it/splitmix64.c

        x += 0x9e3779b97f4a7c15,
        x  = xor_shift_multiply( x, 30, 0xbf58476d1ce4e5b9 ),
        x  = xor_shift_multiply( x, 27, 0x94d049bb133111eb );

        return xor_shift( x, 31 );
    }

public:

    size_t operator()( uint64_t x ) const
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();

        return splitmix64( x + FIXED_RANDOM );
    }
};

#define SAFE_SET( STL, KEY         ) typedef unordered_##STL< KEY,         custom_hash_t > safe_##STL
#define SAFE_MAP( STL, KEY, Mapped ) typedef unordered_##STL< KEY, Mapped, custom_hash_t > safe_##STL

typedef long long ll;

SAFE_SET(      set, ll );
SAFE_SET( multiset, ll );
SAFE_MAP(      map, ll, int );
SAFE_MAP( multimap, ll, int );

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;

gp_hash_table< ll, int, custom_hash_t > safe_gp_hash_table;

#ifdef ONLINE_JUDGE
#undef ONLINE_JUDGE
#endif // ONLINE_JUDGE

/// The time_mointor() code starts here
inline void time_monitor( const string& s, const function< void() >& procedure )
{
#ifndef ONLINE_JUDGE
    typedef chrono::high_resolution_clock clock_t;

    auto start_time  = clock_t::now();
#endif // ONLINE_JUDGE

    procedure();

#ifndef ONLINE_JUDGE
    auto duration = clock_t::now() - start_time;

    typedef chrono::milliseconds time_scale;

    auto elapsed_time = chrono::duration_cast< time_scale >( duration ).count();

    cout << "void " << s << "() used " << elapsed_time << " ms\n";
#endif // ONLINE_JUDGE
}

#define time__( procedure ) time_monitor( #procedure, procedure )

/// The time_mointor() code ends here

template< class T >
void insert_numbers( const ll x )
{
    T numbers; ll w = x, sum = 0;

    for ( size_t i = 1, N = 2e5; i <= N; i++ )
        numbers[ w ] = i, w += x;

    for ( auto p : numbers )
        sum += ( p.first / x ) * p.second;

    cout << "x = " << x << ": sum = " << sum << endl;
}

typedef unordered_map< ll, int > unsafe_map;

int main()
{
    ios_base::sync_with_stdio( false ), cin.tie( nullptr ), cout.tie( nullptr );

    int safe; cin >> safe;

    if ( safe )
        time__( []() { insert_numbers< safe_map >( 107897 ); } ),
        time__( []() { insert_numbers< safe_map >( 126271 ); } );
    else
        time__( []() { insert_numbers< unsafe_map >( 107897 ); } ),
        time__( []() { insert_numbers< unsafe_map >( 126271 ); } );
}