The lockmasters' problem