#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 const *argv[]) {
  int t;
  scanf("%d", &t);
  int input_array[t][2];
  for (int i = 0; i < t; ++i) {
    scanf("%d %d", &input_array[i][0], &input_array[i][1]);
  }
  char before;
  for (int i = 0; i < t; ++i) {
    for (int m = 0; m < input_array[i][0]; ++m) {
      if (m % 2 == 1) {
        before = '*';
      } else {
        before = '.';
      }
      for (int n = 0; n < input_array[i][1]; ++n) {
        if (before == '*') {
          printf("%c", '.');
          before = '.';
        } else {
          printf("%c", '*');
          before = '*';
        }
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec6(%rip),%rdi
xor    %eax,%eax
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11bf <main+0x9f>
mov    -0x48(%rbp),%rdx
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %rdx,%rsi
add    %rax,%rsi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
add    $0x4,%rdx
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b5 <main+0x195>
movl   $0x0,-0x38(%rbp)
mov    -0x48(%rbp),%rcx
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rdx
cmp    (%rcx,%rdx,8),%eax
jge    1299 <main+0x179>
mov    -0x38(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    120a <main+0xea>
movb   $0x2a,-0x2d(%rbp)
jmp    120e <main+0xee>
movb   $0x2e,-0x2d(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%eax
movslq -0x34(%rbp),%rdx
cmp    0x4(%rcx,%rdx,8),%eax
jge    127d <main+0x15d>
movsbl -0x2d(%rbp),%eax
cmp    $0x2a,%eax
jne    1253 <main+0x133>
lea    0xdc8(%rip),%rdi
mov    $0x2e,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x2e,-0x2d(%rbp)
jmp    126a <main+0x14a>
lea    0xdac(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x2a,-0x2d(%rbp)
jmp    126f <main+0x14f>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1215 <main+0xf5>
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11d9 <main+0xb9>
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11c6 <main+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1233 <main+0x113>
lea    0xe90(%rip),%r14
mov    %r12,%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
lea    0x4(%rbx),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
add    $0x8,%rbx
cmp    %rax,%r15
jl     1180 <main+0x60>
test   %eax,%eax
jle    1233 <main+0x113>
xor    %r14d,%r14d
jmp    11c7 <main+0xa7>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
movslq -0x2c(%rbp),%rax
cmp    %rax,%r14
jge    1233 <main+0x113>
cmpl   $0x0,(%r12,%r14,8)
jle    11b0 <main+0x90>
xor    %r13d,%r13d
jmp    11f4 <main+0xd4>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
cmp    (%r12,%r14,8),%r13d
jge    11b0 <main+0x90>
cmpl   $0x0,0x4(%r12,%r14,8)
jle    11e0 <main+0xc0>
xor    %eax,%eax
test   $0x1,%r13b
sete   %al
lea    0x2a(,%rax,4),%ebx
xor    %r15d,%r15d
nop
xor    %eax,%eax
cmp    $0x2a,%ebx
sete   %al
lea    0x2a(,%rax,4),%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    0x4(%r12,%r14,8),%r15d
jl     1210 <main+0xf0>
jmp    11e0 <main+0xc0>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%15 = load i32, i32* %6
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %7
%18 = alloca [2 x i32], i64 %16
store i64 %16, i64* %8
store i32 0, i32* %9
br label %19
19: ; preds = %33, %2
%20 = load i32, i32* %9
%21 = load i32, i32* %6
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 %25
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 %29
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
%32 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %27, i32* %31)
br label %33
33: ; preds = %23
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %19
36: ; preds = %19
store i32 0, i32* %11
br label %37
37: ; preds = %84, %36
%38 = load i32, i32* %11
%39 = load i32, i32* %6
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %87
41: ; preds = %37
store i32 0, i32* %12
br label %42
42: ; preds = %79, %41
%43 = load i32, i32* %12
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 %45
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 0, i64 0
%48 = load i32, i32* %47
%49 = icmp slt i32 %43, %48
br i1 %49, label %50, label %82
50: ; preds = %42
%51 = load i32, i32* %12
%52 = srem i32 %51, 2
%53 = icmp eq i32 %52, 1
br i1 %53, label %54, label %55
54: ; preds = %50
store i8 42, i8* %10
br label %56
55: ; preds = %50
store i8 46, i8* %10
br label %56
56: ; preds = %55, %54
store i32 0, i32* %13
br label %57
57: ; preds = %74, %56
%58 = load i32, i32* %13
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [2 x i32], [2 x i32]* %18, i64 %60
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %61, i64 0, i64 1
%63 = load i32, i32* %62
%64 = icmp slt i32 %58, %63
br i1 %64, label %65, label %77
65: ; preds = %57
%66 = load i8, i8* %10
%67 = sext i8 %66 to i32
%68 = icmp eq i32 %67, 42
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 46)
store i8 46, i8* %10
br label %73
71: ; preds = %65
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 42)
store i8 42, i8* %10
br label %73
73: ; preds = %71, %69
br label %74
74: ; preds = %73
%75 = load i32, i32* %13
%76 = add nsw i32 %75, 1
store i32 %76, i32* %13
br label %57
77: ; preds = %57
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %79
79: ; preds = %77
%80 = load i32, i32* %12
%81 = add nsw i32 %80, 1
store i32 %81, i32* %12
br label %42
82: ; preds = %42
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %84
84: ; preds = %82
%85 = load i32, i32* %11
%86 = add nsw i32 %85, 1
store i32 %86, i32* %11
br label %37
87: ; preds = %37
store i32 0, i32* %3
%88 = load i8*, i8** %7
%89 = load i32, i32* %3
ret i32 %89
}

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