#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 *);
int main(void) {
  int height, width, i, j;
  while (1) {
    scanf("%d %d", &height, &width);
    if (height == 0 && width == 0)
      break;
    for (i = 0; i < height; i++) {
      for (j = 0; j < width; j++) {
        if ((i + j) % 2 == 0) {
          printf("#");
        } else {
          printf(".");
        }
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
jne    115c <main+0x3c>
jmp    11f4 <main+0xd4>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e3 <main+0xc3>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c9 <main+0xa9>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11aa <main+0x8a>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x96>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <main+0x9b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1176 <main+0x56>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <main+0x43>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
mov    %ecx,%edx
or     %eax,%edx
jne    115d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x23,%r13d
lea    0xe96(%rip),%r14
lea    0x4(%rsp),%r15
mov    %rsp,%r12
jmp    11a5 <main+0x85>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    (%rsp),%eax
mov    %ecx,%edx
or     %eax,%edx
je     114c <main+0x2c>
test   %ecx,%ecx
jle    1180 <main+0x60>
xor    %ebx,%ebx
test   %eax,%eax
jle    11db <main+0xbb>
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%rbp,1),%eax
test   $0x1,%al
mov    $0x2e,%edi
cmove  %r13d,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     11c0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jge    1180 <main+0x60>
mov    (%rsp),%eax
test   %eax,%eax
jg     11b0 <main+0x90>
jmp    11db <main+0xbb>

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

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