#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 scanf(char *, long long *);
int main() {
  long long int n;
  while (scanf("%lld", &n) == 1)
    ;
  {
    if (n % 10 != 0) {
      printf("1\n%lld", n % 10);
    } else {
      printf("2");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    114d <main+0x2d>
jmp    112f <main+0xf>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     1189 <main+0x69>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1197 <main+0x77>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec7(%rip),%r14
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1140 <main+0x10>
mov    (%rsp),%rsi
movabs $0x6666666666666667,%rcx
66 66 66
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    %rdx,%rdx
lea    (%rdx,%rdx,4),%rax
sub    %rax,%rsi
je     118e <main+0x5e>
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1198 <main+0x68>
mov    $0x32,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [7 x i8] c"1\0A%lld\00"
@.str.2 = [2 x i8] c"2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i64, i64* %2
%9 = srem i64 %8, 10
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i64, i64* %2
%13 = srem i64 %12, 10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %13)
br label %17
15: ; preds = %7
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %11
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [7 x i8] c"1\0A%lld\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = load i64, i64* %1
%8 = srem i64 %7, 10
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %8)
br label %14
12: ; preds = %6
%13 = call i32 @putchar(i32 50)
br label %14
14: ; preds = %12, %10
ret i32 0
}