Police detain three in robbery, beating at Longview motel