use rug::Integer;

const LIMIT: u64 = 100_000_000;

pub fn solve(n: u64, x: Integer) -> (u64, Integer) {
    let k = LIMIT - n;

    let mut x = x + (k / 4) * 1_640_000;
    for _ in 0..k%4 {
        for _ in 0..10000 {
            x += 41;
            x ^= 42;
        }
    }

    (LIMIT, x)
}