private String invert(String path) {
        String invertedPath = "";

        for (int i = path.length() - 1; i >= 0; i--) {
            char symbol = path.charAt(i);

            if (symbol == EDirection.UP.getSymbol()) {
                invertedPath += EDirection.DOWN.getSymbol();
            } else if (symbol == EDirection.DOWN.getSymbol()) {
                invertedPath += EDirection.UP.getSymbol();
            } else if (symbol == EDirection.RIGHT.getSymbol()) {
                invertedPath += EDirection.LEFT.getSymbol();
            } else if (symbol == EDirection.LEFT.getSymbol()) {
                invertedPath += EDirection.RIGHT.getSymbol();
            } else {
                return null;
            }
        }

        return invertedPath;
    }