 }
 
 class Item {
-    var number = 0
-    var row = 0
-    var column = 0
-    
-    weak var left ,right ,up ,down : Item?
+    open var number = 0
+    open var row = 0
+    open var column = 0
+    
+    fileprivate weak var left ,right ,up ,down : Item?
     init(number : Int) {
         self.number = number
     }

struct Matrix {
    
    let rows, columns: Int
    var ultimateNumber: Int
    var isHaveUnoccupiedItem: Bool
    
    var items: [Item]
    var used: [Item]
    var unused: [Item]
    
    init(rows: Int, columns: Int) {
        

import UIKit

class MatrixView: UIView {
    open var maxNumber: Int
    open var isHaveUnoccupiedView: Bool
    fileprivate var matrix: Matrix
    fileprivate var rows ,columns : Int
    fileprivate var itemViews = [UIButton]()
    
    init(rows: Int, columns: Int) {
        self.rows = rows
        self.columns = columns
        self.maxNumber = 0
        isHaveUnoccupiedView = false
        self.matrix = Matrix(rows: rows, columns:columns)
        super.init(frame: CGRect.zero)
        
