#include <iostream>
#include <iomanip>

using namespace std;

class Random64
{
typedef unsigned long long uint64;
public:
    typedef uint64 RandomValue;
    Random64& operator = (uint64 seed) { X = seed; return *this; }
    Random64(uint64 seed = 0):X(seed){};
    uint64 operator()(uint64 seed = uint64(-1))
    {
        const uint64 a = 3202034522624059733ULL;
        const uint64 c =                   1ULL;

        if (seed != uint64(-1)) X = seed;
        uint64 Y = a * X + c;
        X = a * Y + c;
        Y = (Y&0xFFFFFFFF00000000ULL) | (X >> 32);
        return Y;
    }
    // Не включая max
    uint64 operator()(uint64 min, uint64 max)
    {
        return (*this)()%(max-min) + min;
    }
private:
    uint64 X;
};

int main(int argc, const char * argv[])
{
    Random64 r(time(0));

    for(int i = 0; i < 100; ++i)
        cout << hex << setfill('0') << setw(16) << r() << endl;
}
