#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 main() {
  int n, a = 0, b = 0;
  char c;
  scanf("%d\n", &n);
  while (n--) {
    scanf("%c", &c);
    if (c == 'A')
      ++a;
    else
      ++b;
  }
  if (a > b)
    printf("Anton");
  else if (a < b)
    printf("Danik");
  else
    printf("Friendship");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     119e <main+0x7e>
lea    0xe9a(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x41,%eax
jne    1190 <main+0x70>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1199 <main+0x79>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114f <main+0x2f>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11bb <main+0x9b>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d8 <main+0xb8>
lea    0xe3f(%rip),%rdi
call   1030 <printf@plt>
jmp    11e4 <main+0xc4>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     119f <main+0x7f>
lea    0xebc(%rip),%r14
lea    0x3(%rsp),%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
xor    %ecx,%ecx
cmpb   $0x41,0x3(%rsp)
setne  %al
sete   %cl
add    %ecx,%ebx
add    %eax,%ebp
subl   $0x1,0x4(%rsp)
jae    1160 <main+0x40>
cmp    %ebp,%ebx
jbe    1194 <main+0x74>
lea    0xe75(%rip),%rdi
jmp    11a6 <main+0x86>
jae    119f <main+0x7f>
lea    0xe70(%rip),%rdi
jmp    11a6 <main+0x86>
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [6 x i8] c"Anton\00"
@.str.3 = [6 x i8] c"Danik\00"
@.str.4 = [11 x i8] c"Friendship\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %26, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %18, %8 ], [ 0, %0 ]
%10 = phi i32 [ %15, %8 ], [ 0, %0 ]
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%12 = load i8, i8* %2
%13 = icmp eq i8 %12, 65
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %10, %14
%16 = xor i1 %13, true
%17 = zext i1 %16 to i32
%18 = add nuw nsw i32 %9, %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, -1
store i32 %20, i32* %1
%21 = icmp eq i32 %19, 0
br i1 %21, label %22, label %8
22: ; preds = %8
%23 = icmp ugt i32 %15, %18
br i1 %23, label %27, label %24
24: ; preds = %22
%25 = icmp ult i32 %15, %18
br i1 %25, label %27, label %26
26: ; preds = %0, %24
br label %27
27: ; preds = %24, %22, %26
%28 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %26 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %22 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %24 ]
%29 = call i32 @printf(i8* dereferenceable(1) %28)
ret i32 0
}