#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char *argv[]) {
  int a, b, k, i, j, m;
  scanf("%i%i%i", &a, &b, &k);
  for (i = 0; i < a; i++)
    for (j = 0; j < b; j++) {
      scanf("%i", &m);
      if (m == k) {
        printf("%i %i", ++i, ++j);
        return 0;
      }
    }
  printf("biantai");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11e6 <main+0xc6>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11d3 <main+0xb3>
lea    0xe8d(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    11c0 <main+0xa0>
mov    -0x20(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x20(%rbp)
mov    -0x24(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11fb <main+0xdb>
jmp    11c5 <main+0xa5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116a <main+0x4a>
jmp    11d8 <main+0xb8>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1157 <main+0x37>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x14(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    11c1 <main+0xa1>
mov    0x8(%rsp),%eax
lea    0xeb0(%rip),%r14
lea    0x10(%rsp),%r15
xor    %ebp,%ebp
jmp    1177 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    %ecx,%ebp
jge    11c1 <main+0xa1>
test   %eax,%eax
jle    1170 <main+0x50>
mov    $0x1,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    0x14(%rsp),%eax
je     11aa <main+0x8a>
mov    0x8(%rsp),%eax
lea    0x1(%rbx),%ecx
cmp    %eax,%ebx
mov    %ecx,%ebx
jl     1180 <main+0x60>
mov    0xc(%rsp),%ecx
jmp    1170 <main+0x50>
add    $0x1,%ebp
lea    0xe53(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11cf <main+0xaf>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%i%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"%i %i\00"
@.str.3 = [8 x i8] c"biantai\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
store i32 0, i32* %9
br label %13
13: ; preds = %38, %2
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %41
17: ; preds = %13
store i32 0, i32* %10
br label %18
18: ; preds = %34, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %37
22: ; preds = %18
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%24 = load i32, i32* %11
%25 = load i32, i32* %8
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
%30 = load i32, i32* %10
%31 = add nsw i32 %30, 1
store i32 %31, i32* %10
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %31)
store i32 0, i32* %3
br label %43
33: ; preds = %22
br label %34
34: ; preds = %33
%35 = load i32, i32* %10
%36 = add nsw i32 %35, 1
store i32 %36, i32* %10
br label %18
37: ; preds = %18
br label %38
38: ; preds = %37
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %13
41: ; preds = %13
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %43
43: ; preds = %41, %27
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [7 x i8] c"%i%i%i\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"%i %i\00"
@.str.3 = [8 x i8] c"biantai\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %42
14: ; preds = %2
%15 = load i32, i32* %4
br label %16
16: ; preds = %14, %37
%17 = phi i32 [ %38, %37 ], [ %12, %14 ]
%18 = phi i32 [ %39, %37 ], [ %15, %14 ]
%19 = phi i32 [ %40, %37 ], [ 0, %14 ]
%20 = icmp sgt i32 %18, 0
br i1 %20, label %21, label %37
21: ; preds = %16, %31
%22 = phi i32 [ %32, %31 ], [ 0, %16 ]
%23 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%24 = load i32, i32* %6
%25 = load i32, i32* %5
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %21
%28 = add nuw nsw i32 %19, 1
%29 = add nuw nsw i32 %22, 1
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %29)
br label %44
31: ; preds = %21
%32 = add nuw nsw i32 %22, 1
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %21, label %35
35: ; preds = %31
%36 = load i32, i32* %3
br label %37
37: ; preds = %35, %16
%38 = phi i32 [ %36, %35 ], [ %17, %16 ]
%39 = phi i32 [ %33, %35 ], [ %18, %16 ]
%40 = add nuw nsw i32 %19, 1
%41 = icmp slt i32 %40, %38
br i1 %41, label %16, label %42
42: ; preds = %37, %2
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %44
44: ; preds = %42, %27
ret i32 0
}