     let b = b % m
     let c = m &- b
     return a < c ? a &+ b : a &- c
+}
+
+public func >><T: UnsignedInteger>(lhs: T, rhs: T) -> T {
+    return T(lhs.toUIntMax() >> rhs.toUIntMax())
 }
 
 public func mulmod<T: UnsignedInteger>(_ a: T, _ b: T, _ m: T) -> T {

}

public func pow<T: UnsignedInteger>(_ x: T, _ n: T, _ m: T) -> T {
    func _pow(_ x: UIntMax, _ n: UIntMax, _ m: UIntMax) -> UIntMax {
        let x = x % m
        if x == 0 || m == 1 {
            return 0
        }
        if n == 0 {
            return 1
        }
        let p = _pow(mulmod(x, x, m), n >> 1, m)
        return n & 1 == 1 ? mulmod(x, p, m) : p
    }
    assert(m != 0, "divide by zero")
    return T(_pow(x.toUIntMax(), n.toUIntMax(), m.toUIntMax()))
}

public func pow(_ x: UInt, _ n: UInt) -> UInt {

    return UInt(bitPattern: log2(Int(bitPattern: x)))
}

public extension UnsignedInteger {
    
    var hibit: Self {
        let n = UIntMax(MemoryLayout<Self>.size)
        var x = self
        for i in 1..<n {
            x |= Self(x.toUIntMax() >> i)
        }
        return (x + 1) >> 1
    }
}

public extension Int64 {
    
    var hibit: Int64 {
