#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*/ atoi(char *);
char b2d(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, ...);
int main() {
  int i = 0, j, k, l, m;
  char c[120000], t[10], f[10000];
  scanf("%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c");
  while (scanf("%c", &c[i]) == 1) {
    if (c[i] == '_')
      break;
    i++;
  }
  for (k = 0; c[k] != '_'; k++) {
    if (c[k] == 'o')
      c[k] = '1';
    else if (c[k] == ' ')
      c[k] = '0';
  }
  scanf("%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c");
  for (l = 0, m = 0; l < k; l += 12, m++) {
    for (j = l + 1, i = 0; j < l + 6; i++, j++) {
      t[i] = c[j];
    }
    j++;
    for (; j < l + 10; i++, j++) {
      t[i] = c[j];
    }
    t[i] = '\0';
    f[m] = b2d(atoi(t));
  }
  f[m] = '\0';
  printf("%s", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1fc00,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movslq -0x8(%rbp),%rax
lea    -0x1d4e0(%rbp),%rsi
add    %rax,%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11b4 <main+0x74>
movslq -0x8(%rbp),%rax
movsbl -0x1d4e0(%rbp,%rax,1),%eax
ff
cmp    $0x5f,%eax
jne    11a6 <main+0x66>
jmp    11b4 <main+0x74>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1167 <main+0x27>
movl   $0x0,-0x10(%rbp)
movslq -0x10(%rbp),%rax
movsbl -0x1d4e0(%rbp,%rax,1),%eax
ff
cmp    $0x5f,%eax
je     122f <main+0xef>
movslq -0x10(%rbp),%rax
movsbl -0x1d4e0(%rbp,%rax,1),%eax
ff
cmp    $0x6f,%eax
jne    11f6 <main+0xb6>
movslq -0x10(%rbp),%rax
movb   $0x31,-0x1d4e0(%rbp,%rax,1)
31
jmp    121c <main+0xdc>
movslq -0x10(%rbp),%rax
movsbl -0x1d4e0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
jne    1217 <main+0xd7>
movslq -0x10(%rbp),%rax
movb   $0x30,-0x1d4e0(%rbp,%rax,1)
30
jmp    121c <main+0xdc>
jmp    1221 <main+0xe1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bb <main+0x7b>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    132f <main+0x1ef>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x6,%ecx
cmp    %ecx,%eax
jge    12a5 <main+0x165>
movslq -0xc(%rbp),%rax
mov    -0x1d4e0(%rbp,%rax,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x1d4ea(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1267 <main+0x127>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    12ec <main+0x1ac>
movslq -0xc(%rbp),%rax
mov    -0x1d4e0(%rbp,%rax,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x1d4ea(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    12ae <main+0x16e>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x1d4ea(%rbp,%rax,1)
lea    -0x1d4ea(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1030 <b2d@plt>
mov    %al,%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x1fc00(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    124b <main+0x10b>
movslq -0x18(%rbp),%rax
movb   $0x0,-0x1fc00(%rbp,%rax,1)
lea    -0x1fc00(%rbp),%rsi
lea    0xcdf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1fc00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1fbe8,%rsp
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
lea    0x2720(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11ad <main+0x6d>
lea    0x2721(%rsp),%r14
lea    0xe99(%rip),%r15
nopl   0x0(%rax)
cmpb   $0x5f,-0x1(%r14)
je     11ad <main+0x6d>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%r14
cmp    $0x1,%eax
je     1190 <main+0x50>
mov    $0x1,%r14d
jmp    11cc <main+0x8c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x30,%cl
mov    %cl,(%rbx)
add    $0xffffffff,%r14d
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x20,%al
je     11c0 <main+0x80>
mov    $0x31,%cl
cmp    $0x6f,%al
je     11c2 <main+0x82>
cmp    $0x5f,%al
jne    11c4 <main+0x84>
lea    0xe22(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <scanf@plt>
cmp    $0x1,%r14d
je     1288 <main+0x148>
neg    %r14d
lea    0x9(%rsp),%r12
mov    $0xaaaaaaab,%eax
mov    %r14,%r15
imul   %rax,%r15
shr    $0x23,%r15
add    $0x1,%r15d
lea    0x2721(%rsp),%rbx
mov    %r14d,%r13d
imul   %rax,%r13
shr    $0x23,%r13
add    $0x1,%r13
xor    %ebp,%ebp
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x4(%rbx),%eax
mov    %al,0x8(%rsp)
mov    (%rbx),%eax
mov    %eax,0x4(%rsp)
movzbl 0x8(%rbx),%eax
mov    %al,0x2(%r12)
movzwl 0x6(%rbx),%eax
mov    %ax,(%r12)
movb   $0x0,0xc(%rsp)
mov    %r14,%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1030 <b2d@plt>
mov    %al,0x10(%rsp,%rbp,1)
add    $0x1,%rbp
add    $0xc,%rbx
cmp    %rbp,%r13
jne    1240 <main+0x100>
mov    %r15d,%ebx
movb   $0x0,0x10(%rsp,%rbx,1)
lea    0xd94(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1fbe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [31 x i8] c"%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [120000 x i8]
%8 = alloca [10 x i8]
%9 = alloca [10000 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %25, %0
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %13
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %28
17: ; preds = %11
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 95
br i1 %23, label %24, label %25
24: ; preds = %17
br label %28
25: ; preds = %17
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %11
28: ; preds = %24, %11
store i32 0, i32* %4
br label %29
29: ; preds = %60, %28
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 95
br i1 %35, label %36, label %63
36: ; preds = %29
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 111
br i1 %42, label %43, label %47
43: ; preds = %36
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %45
store i8 49, i8* %46
br label %59
47: ; preds = %36
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 32
br i1 %53, label %54, label %58
54: ; preds = %47
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %56
store i8 48, i8* %57
br label %58
58: ; preds = %54, %47
br label %59
59: ; preds = %58, %43
br label %60
60: ; preds = %59
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %29
63: ; preds = %29
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
store i32 0, i32* %6
br label %65
65: ; preds = %121, %63
%66 = load i32, i32* %5
%67 = load i32, i32* %4
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %126
69: ; preds = %65
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
store i32 0, i32* %2
br label %72
72: ; preds = %85, %69
%73 = load i32, i32* %3
%74 = load i32, i32* %5
%75 = add nsw i32 %74, 6
%76 = icmp slt i32 %73, %75
br i1 %76, label %77, label %90
77: ; preds = %72
%78 = load i32, i32* %3
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %79
%81 = load i8, i8* %80
%82 = load i32, i32* %2
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 %83
store i8 %81, i8* %84
br label %85
85: ; preds = %77
%86 = load i32, i32* %2
%87 = add nsw i32 %86, 1
store i32 %87, i32* %2
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %72
90: ; preds = %72
%91 = load i32, i32* %3
%92 = add nsw i32 %91, 1
store i32 %92, i32* %3
br label %93
93: ; preds = %106, %90
%94 = load i32, i32* %3
%95 = load i32, i32* %5
%96 = add nsw i32 %95, 10
%97 = icmp slt i32 %94, %96
br i1 %97, label %98, label %111
98: ; preds = %93
%99 = load i32, i32* %3
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [120000 x i8], [120000 x i8]* %7, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = load i32, i32* %2
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 %104
store i8 %102, i8* %105
br label %106
106: ; preds = %98
%107 = load i32, i32* %2
%108 = add nsw i32 %107, 1
store i32 %108, i32* %2
%109 = load i32, i32* %3
%110 = add nsw i32 %109, 1
store i32 %110, i32* %3
br label %93
111: ; preds = %93
%112 = load i32, i32* %2
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 %113
store i8 0, i8* %114
%115 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%116 = call i32 @atoi(i8* %115)
%117 = call signext i8 @b2d(i32 %116)
%118 = load i32, i32* %6
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 %119
store i8 %117, i8* %120
br label %121
121: ; preds = %111
%122 = load i32, i32* %5
%123 = add nsw i32 %122, 12
store i32 %123, i32* %5
%124 = load i32, i32* %6
%125 = add nsw i32 %124, 1
store i32 %125, i32* %6
br label %65
126: ; preds = %65
%127 = load i32, i32* %6
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 %128
store i8 0, i8* %129
%130 = getelementptr inbounds [10000 x i8], [10000 x i8]* %9, i64 0, i64 0
%131 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %130)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [31 x i8] c"%*c%*c%*c%*c%*c%*c%*c%*c%*c%*c\00"
@.str.3 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [120000 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = alloca [10000 x i8]
%5 = getelementptr inbounds [120000 x i8], [120000 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%10 = icmp eq i32 %9, 1
br i1 %10, label %15, label %21
11: ; preds = %15
%12 = getelementptr inbounds [120000 x i8], [120000 x i8]* %1, i64 0, i64 %20
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %21
15: ; preds = %0, %11
%16 = phi i64 [ %20, %11 ], [ 0, %0 ]
%17 = phi i8* [ %12, %11 ], [ %5, %0 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 95
%20 = add nuw i64 %16, 1
br i1 %19, label %21, label %11
21: ; preds = %11, %15, %0
br label %22
22: ; preds = %21, %29
%23 = phi i64 [ %30, %29 ], [ 0, %21 ]
%24 = getelementptr inbounds [120000 x i8], [120000 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
switch i8 %25, label %29 [
i8 95, label %31
i8 111, label %27
i8 32, label %26
]
26: ; preds = %22
br label %27
27: ; preds = %22, %26
%28 = phi i8 [ 48, %26 ], [ 49, %22 ]
store i8 %28, i8* %24
br label %29
29: ; preds = %27, %22
%30 = add nuw i64 %23, 1
br label %22
31: ; preds = %22
%32 = trunc i64 %23 to i32
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 %32, 0
br i1 %34, label %56, label %35
35: ; preds = %31
%36 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 5
%37 = add i32 %32, -1
%38 = udiv i32 %37, 12
%39 = add nuw nsw i32 %38, 1
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 8
br label %42
42: ; preds = %35, %42
%43 = phi i64 [ 0, %35 ], [ %52, %42 ]
%44 = mul nuw nsw i64 %43, 12
%45 = add nuw nsw i64 %44, 7
%46 = getelementptr [120000 x i8], [120000 x i8]* %1, i64 0, i64 %45
%47 = or i64 %44, 1
%48 = getelementptr [120000 x i8], [120000 x i8]* %1, i64 0, i64 %47
store i8 0, i8* %41
%49 = call i32 @atoi(i8* %6)
%50 = call signext i8 @b2d(i32 %49)
%51 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %43
store i8 %50, i8* %51
%52 = add nuw nsw i64 %43, 1
%53 = icmp eq i64 %52, %40
br i1 %53, label %54, label %42
54: ; preds = %42
%55 = zext i32 %39 to i64
br label %56
56: ; preds = %31, %54
%57 = phi i64 [ %55, %54 ], [ 0, %31 ]
%58 = getelementptr inbounds [10000 x i8], [10000 x i8]* %4, i64 0, i64 %57
store i8 0, i8* %58
%59 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %7)
ret i32 0
}