import std.stdio;

void position(int n, int row, int col, char[6][1000] rows)
{
	rows[row][col] = rows[row][col + 1] = '+';

	printf("YES\n");
	for (int i = 0; i < n; i++) {
		printf("%s\n", rows[i].ptr);
	}
}

void main()
{
	int n;
	scanf("%d", &n);

	char[6][1000] rows;
	for (int i = 0; i < n; i++) {
		scanf("%s", rows[i].ptr);
	}

	for (int i = 0; i < n; i++) {
		if (rows[i][0] == 'O' && rows[i][1] == 'O') {
			position(n, i, 0, rows);
			return;
		}
		if (rows[i][3] == 'O' && rows[i][4] == 'O') {
			position(n, i, 3, rows);
			return;
		}
	}

	printf("NO\n");
}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/D/Source_71/source.d'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/D/Source_71/source.d"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

%0 = type { i32, i32, [7 x i8] }
%object.ModuleInfo = type { i32, i32 }

@.str = private unnamed_addr constant [59 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/D/Source_71/source.d\00" ; [#uses = 1]
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00" ; [#uses = 1]
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00" ; [#uses = 1]
@_D6source12__ModuleInfoZ = global %0 { i32 -2147483644, i32 0, [7 x i8] c"source\00" } ; [#uses = 1]
@_D6source11__moduleRefZ = linkonce_odr hidden global %object.ModuleInfo* bitcast (%0* @_D6source12__ModuleInfoZ to %object.ModuleInfo*), section "__minfo" ; [#uses = 1]
@__start___minfo = external hidden global %object.ModuleInfo* ; [#uses = 1]
@__stop___minfo = external hidden global %object.ModuleInfo* ; [#uses = 1]
@ldc.dso_slot = linkonce_odr hidden global i8* null ; [#uses = 1]
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ldc.register_dso, i8* bitcast (void ()* @ldc.register_dso to i8*) }] ; [#uses = 0]
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ldc.register_dso, i8* bitcast (void ()* @ldc.register_dso to i8*) }] ; [#uses = 0]
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; [#uses = 1]
@str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; [#uses = 1]
@llvm.used = appending global [1 x i8*] [i8* bitcast (%object.ModuleInfo** @_D6source11__moduleRefZ to i8*)], section "llvm.metadata" ; [#uses = 0]

; [#uses = 2]
; Function Attrs: uwtable
define void @_D6source8positionFiiiG1000G6aZv([1000 x [6 x i8]]* nocapture byval align 1 %rows, i32 %col_arg, i32 %row_arg, i32 %n_arg) local_unnamed_addr #0 {
  %1 = sext i32 %row_arg to i64                   ; [#uses = 3]
  %bounds.cmp = icmp ult i32 %row_arg, 1000       ; [#uses = 1]
  br i1 %bounds.cmp, label %bounds.ok, label %bounds.fail

bounds.ok:                                        ; preds = %0
  %2 = sext i32 %col_arg to i64                   ; [#uses = 2]
  %bounds.cmp1 = icmp ult i32 %col_arg, 6         ; [#uses = 1]
  br i1 %bounds.cmp1, label %bounds.ok2, label %bounds.fail3

bounds.ok2:                                       ; preds = %bounds.ok
  %3 = add nuw nsw i32 %col_arg, 1                ; [#uses = 1]
  %4 = sext i32 %3 to i64                         ; [#uses = 2]
  %bounds.cmp7.not = icmp eq i32 %col_arg, 5      ; [#uses = 1]
  br i1 %bounds.cmp7.not, label %bounds.fail9, label %bounds.ok8

bounds.ok8:                                       ; preds = %bounds.ok2
  %5 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %1, i64 %2 ; [#uses = 1, type = i8*]
  %6 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %1, i64 %4 ; [#uses = 1, type = i8*]
  store i8 43, i8* %6, align 1
  store i8 43, i8* %5, align 1
  %puts = tail call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0)) ; [#uses = 0]
  %7 = icmp sgt i32 %n_arg, 0                     ; [#uses = 1]
  %smax = select i1 %7, i32 %n_arg, i32 0         ; [#uses = 1]
  %wide.trip.count = zext i32 %smax to i64        ; [#uses = 1]
  br label %forcond

forcond:                                          ; preds = %bounds.ok11, %bounds.ok8
  %indvars.iv = phi i64 [ %indvars.iv.next, %bounds.ok11 ], [ 0, %bounds.ok8 ] ; [#uses = 4, type = i64]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count ; [#uses = 1]
  br i1 %exitcond.not, label %endfor, label %forbody

forbody:                                          ; preds = %forcond
  %exitcond25.not = icmp eq i64 %indvars.iv, 1000 ; [#uses = 1]
  br i1 %exitcond25.not, label %bounds.fail12, label %bounds.ok11

bounds.ok11:                                      ; preds = %forbody
  %8 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv, i64 0 ; [#uses = 1, type = i8*]
  %puts23 = call i32 @puts(i8* nonnull %8)        ; [#uses = 0]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; [#uses = 1]
  br label %forcond

bounds.fail12:                                    ; preds = %forbody
  tail call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 9, i64 1000, i64 1000) #1
  unreachable

endfor:                                           ; preds = %forcond
  ret void

bounds.fail9:                                     ; preds = %bounds.ok2
  tail call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 5, i64 %4, i64 6) #1
  unreachable

bounds.fail3:                                     ; preds = %bounds.ok
  tail call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 5, i64 %2, i64 6) #1
  unreachable

bounds.fail:                                      ; preds = %0
  tail call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 5, i64 %1, i64 1000) #1
  unreachable
}

; [#uses = 6]
; Function Attrs: cold noreturn uwtable
declare void @_d_arraybounds_index({ i64, i8* }, i32, i64, i64) local_unnamed_addr #1

; [#uses = 1]
; Function Attrs: uwtable
define i32 @_Dmain({ i64, { i64, i8* }* } %unnamed) #2 {
  %n = alloca i32, align 4                        ; [#uses = 3, size/byte = 4]
  %rows = alloca [1000 x [6 x i8]], align 1       ; [#uses = 8, size/byte = 6000]
  store i32 0, i32* %n, align 4
  %1 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* nonnull %n) #5 ; [#uses = 0]
  %2 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 0, i64 0 ; [#uses = 1, type = i8*]
  call void @llvm.memset.p0i8.i64(i8* nonnull align 1 dereferenceable(6000) %2, i8 -1, i64 6000, i1 false)
  br label %forcond

forcond:                                          ; preds = %bounds.ok, %0
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %bounds.ok ], [ 0, %0 ] ; [#uses = 4, type = i64]
  %3 = load i32, i32* %n, align 4                 ; [#uses = 5]
  %4 = sext i32 %3 to i64                         ; [#uses = 1]
  %5 = icmp slt i64 %indvars.iv51, %4             ; [#uses = 1]
  br i1 %5, label %forbody, label %forcond2.preheader

forcond2.preheader:                               ; preds = %forcond
  %6 = icmp sgt i32 %3, 0                         ; [#uses = 1]
  %smax = select i1 %6, i32 %3, i32 0             ; [#uses = 1]
  %wide.trip.count = zext i32 %smax to i64        ; [#uses = 1]
  br label %forcond2

forbody:                                          ; preds = %forcond
  %exitcond53.not = icmp eq i64 %indvars.iv51, 1000 ; [#uses = 1]
  br i1 %exitcond53.not, label %bounds.fail, label %bounds.ok

bounds.ok:                                        ; preds = %forbody
  %7 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv51, i64 0 ; [#uses = 1, type = i8*]
  %8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* nonnull %7) #5 ; [#uses = 0]
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1 ; [#uses = 1]
  br label %forcond

bounds.fail:                                      ; preds = %forbody
  call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 20, i64 1000, i64 1000) #1
  unreachable

forcond2:                                         ; preds = %forcond2.preheader, %forinc4
  %indvars.iv = phi i64 [ 0, %forcond2.preheader ], [ %indvars.iv.next, %forinc4 ] ; [#uses = 9, type = i64]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count ; [#uses = 1]
  br i1 %exitcond.not, label %endfor5, label %forbody3

forbody3:                                         ; preds = %forcond2
  %exitcond50.not = icmp eq i64 %indvars.iv, 1000 ; [#uses = 1]
  br i1 %exitcond50.not, label %bounds.fail8, label %bounds.ok7

bounds.ok7:                                       ; preds = %forbody3
  %9 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv, i64 0 ; [#uses = 1, type = i8*]
  %10 = load i8, i8* %9, align 1                  ; [#uses = 1]
  %11 = icmp eq i8 %10, 79                        ; [#uses = 1]
  br i1 %11, label %bounds.ok10, label %bounds.ok13

bounds.ok10:                                      ; preds = %bounds.ok7
  %12 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv, i64 1 ; [#uses = 1, type = i8*]
  %13 = load i8, i8* %12, align 1                 ; [#uses = 1]
  %14 = icmp eq i8 %13, 79                        ; [#uses = 1]
  br i1 %14, label %if, label %bounds.ok13

if:                                               ; preds = %bounds.ok10
  %15 = trunc i64 %indvars.iv to i32              ; [#uses = 1]
  call void @_D6source8positionFiiiG1000G6aZv([1000 x [6 x i8]]* nonnull byval align 1 %rows, i32 0, i32 %15, i32 %3) #0
  ret i32 0

bounds.ok13:                                      ; preds = %bounds.ok10, %bounds.ok7
  %16 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv, i64 3 ; [#uses = 1, type = i8*]
  %17 = load i8, i8* %16, align 1                 ; [#uses = 1]
  %18 = icmp eq i8 %17, 79                        ; [#uses = 1]
  br i1 %18, label %bounds.ok18, label %forinc4

bounds.ok18:                                      ; preds = %bounds.ok13
  %19 = getelementptr inbounds [1000 x [6 x i8]], [1000 x [6 x i8]]* %rows, i64 0, i64 %indvars.iv, i64 4 ; [#uses = 1, type = i8*]
  %20 = load i8, i8* %19, align 1                 ; [#uses = 1]
  %21 = icmp eq i8 %20, 79                        ; [#uses = 1]
  br i1 %21, label %if21, label %forinc4

if21:                                             ; preds = %bounds.ok18
  %22 = trunc i64 %indvars.iv to i32              ; [#uses = 1]
  call void @_D6source8positionFiiiG1000G6aZv([1000 x [6 x i8]]* nonnull byval align 1 %rows, i32 3, i32 %22, i32 %3) #0
  ret i32 0

bounds.fail8:                                     ; preds = %forbody3
  call void @_d_arraybounds_index({ i64, i8* } { i64 58, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i32 0, i32 0) }, i32 24, i64 1000, i64 1000) #1
  unreachable

forinc4:                                          ; preds = %bounds.ok18, %bounds.ok13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 ; [#uses = 1]
  br label %forcond2

endfor5:                                          ; preds = %forcond2
  %puts = call i32 @puts(i8* nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.6, i64 0, i64 0)) ; [#uses = 0]
  ret i32 0
}

; [#uses = 2]
; Function Attrs: nofree nounwind
declare i32 @scanf(i8* nocapture readonly, ...) local_unnamed_addr #3

; [#uses = 1]
; Function Attrs: argmemonly nounwind willreturn writeonly
declare void @llvm.memset.p0i8.i64(i8* nocapture writeonly, i8, i64, i1 immarg) #4

; [#uses = 1]
declare i32 @_d_run_main(i32, i8**, i8*) local_unnamed_addr #5

; [#uses = 0]
; Function Attrs: uwtable
define i32 @main(i32 %argc_arg, i8** %argv_arg) local_unnamed_addr #0 {
  %1 = tail call i32 @_d_run_main(i32 %argc_arg, i8** %argv_arg, i8* bitcast (i32 ({ i64, { i64, i8* }* })* @_Dmain to i8*)) #5 ; [#uses = 1]
  ret i32 %1
}

; [#uses = 2]
define linkonce_odr hidden void @ldc.register_dso() {
  %1 = alloca { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }, align 8 ; [#uses = 5, size/byte = 32]
  %2 = getelementptr inbounds { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }, { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }* %1, i64 0, i32 0 ; [#uses = 1, type = i64*]
  store i64 1, i64* %2, align 8
  %3 = getelementptr inbounds { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }, { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }* %1, i64 0, i32 1 ; [#uses = 1, type = i8***]
  store i8** @ldc.dso_slot, i8*** %3, align 8
  %4 = getelementptr inbounds { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }, { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }* %1, i64 0, i32 2 ; [#uses = 1, type = %object.ModuleInfo***]
  store %object.ModuleInfo** @__start___minfo, %object.ModuleInfo*** %4, align 8
  %5 = getelementptr inbounds { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }, { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }* %1, i64 0, i32 3 ; [#uses = 1, type = %object.ModuleInfo***]
  store %object.ModuleInfo** @__stop___minfo, %object.ModuleInfo*** %5, align 8
  %6 = bitcast { i64, i8**, %object.ModuleInfo**, %object.ModuleInfo** }* %1 to i8* ; [#uses = 1]
  call void @_d_dso_registry(i8* nonnull %6)
  ret void
}

; [#uses = 1]
; Function Attrs: uwtable
declare void @_d_dso_registry(i8*) local_unnamed_addr #6

; [#uses = 3]
; Function Attrs: nofree nounwind
declare i32 @puts(i8* nocapture readonly) local_unnamed_addr #7

attributes #0 = { uwtable "frame-pointer"="none" "target-cpu"="x86-64" "target-features"="+cx16" }
attributes #1 = { cold noreturn uwtable }
attributes #2 = { uwtable "frame-pointer"="none" "target-cpu"="x86-64" "target-features"="+cx16,+cx16" }
attributes #3 = { nofree nounwind "frame-pointer"="none" "target-cpu"="x86-64" "target-features"="+cx16" }
attributes #4 = { argmemonly nounwind willreturn writeonly }
attributes #5 = { "frame-pointer"="none" "target-cpu"="x86-64" "target-features"="+cx16" }
attributes #6 = { uwtable }
attributes #7 = { nofree nounwind }

!llvm.ident = !{!0}

!0 = !{!"ldc version 1.28.0"}
