package main

import "fmt"

func main(){
	var m map[byte]int
	var n int
	var c byte
	m = make(map[byte]int)

	fmt.Scan(&n)

	for i:=0; i<n ; i++{
		if i==0{
			fmt.Scanf("%c",&c)
		}

		fmt.Scanf("%c",&c)
		m[c]++
		//fmt.Println(c," = ",m[c])
	}

	if m['D'] < m['A']{
		fmt.Println("Anton")
	}else if m['D'] > m['A']{
		fmt.Println("Danik")
	}else{
		fmt.Println("Friendship")
	}
}

package main
import "fmt"

func main() {
	n, seq := 0, ""
	fmt.Scanf("%d\n%s", &n, &seq)
	anton := 0
	for _, c := range seq {
		if c == 'A' {
			anton++
		}
	}
	result := "Friendship"
	danik := len(seq) - anton
	if anton > danik {
		result = "Anton"
	} else if anton < danik {
		result = "Danik"
	}
	fmt.Println(result)
}

package main

import (
	"fmt"
)

func main() {
	n, seq := 0, ""
	fmt.Scanf("%d\n%s", &n, &seq)
	anton, danik := 0, 0
	for i := 0; i < len(seq); i++ {
		if seq[i] == 'A' {
			anton++
		} else {
			danik++
		}
	}
	result := "Friendship"
	if anton > danik {
		result = "Anton"
	} else if anton < danik {
		result = "Danik"
	}
	fmt.Println(result)
}

package main
import (
	 "fmt"
	 "strings"
)

func main() {
	 var s string
	 var a, ct, mt int
	 fmt.Scan(&a)
	 fmt.Scan(&s)

	 x := strings.Split(s, "")
	 for _, i := range x {
	 	   if string(i) == "A" {
	 	   		ct ++
	 	   } else {
	 	   		mt ++
	 	   }
	 }

	 if ct > mt {
	 	 fmt.Println("Anton")
	 } else if ct < mt {
	 	 fmt.Println("Danik")
	 } else {
	 	 fmt.Println("Friendship")
	 }
}

package main

import "fmt"

func main() {
	var n int
	var s string
	fmt.Scan(&n)
	fmt.Scan(&s)
	var a, d int
	for i := 0; i < n; i++ {
		r := s[i]
		if r == 'A' {
			a++
		} else if r == 'D' {
			d++
		}
	}
	if a > d {
		fmt.Print("Anton")
	} else if a < d {
		fmt.Print("Danik")
	} else {
		fmt.Print("Friendship")
	}
}

package main;

import "fmt"

func main() {

    var n int;
    var str string;

    fmt.Scanf("%d", &n);

    fmt.Scanf("%s", &str);
    fmt.Scanf("%s", &str);

    a := 0
    d := 0

    for i := 0; i < n; i++ {
		if str[i] == 'A' {
		    a = a + 1
		} else {
		    d = d + 1
		}
	}

	if a == d {
	    fmt.Printf("Friendship\n");
	} else if a > d {
	    fmt.Printf("Anton\n");
	} else {
	    fmt.Printf("Danik\n");
	}

}

package main

import (
	"fmt"
)

func main() {
	var numberOfGames int
	fmt.Scan(&numberOfGames)

	var myString string
	fmt.Scan(&myString)
	var aCount int
	var dCount int
	for index := 0; index < numberOfGames; index++ {
		if myString[index] == 'A' {
			aCount++
		} else {
			dCount++
		}
	}
	if aCount > dCount {
		fmt.Println("Anton")
	} else if aCount < dCount {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var numberOfGames int
	fmt.Scan(&numberOfGames)

	var myString string
	fmt.Scan(&myString)
	var aWin int
	for index := 0; index < numberOfGames; index++ {
		if myString[index] == 'A' {
			aWin++
		} else {
			aWin--
		}
	}
	if aWin > 0 {
		fmt.Println("Anton")
	} else if aWin < 0 {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var numberOfGames int
	fmt.Scan(&numberOfGames)

	var myString string
	fmt.Scan(&myString)
	m := make(map[byte]int)
	m['A'] = 0
	m['D'] = 0
	for index := 0; index < numberOfGames; index++ {
		m[myString[index]]++
	}
	if m['A'] > m['D'] {
		fmt.Println("Anton")
	} else if m['A'] < m['D'] {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"bufio"
	"os"
)

func main() {
	var a, d int
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	line, _ := reader.ReadString('\n')
	line, _ = reader.ReadString('\n')
	for i := range line {
		switch line[i] {
		case 'A':
			a++
		case 'D':
			d++
		}
	}
	if a > d {
		writer.WriteString("Anton")
	} else if d > a {
		writer.WriteString("Danik")
	} else {
		writer.WriteString("Friendship")
	}
	writer.Flush()
}

package main

import (
	"fmt"

)

func main() {
	var n,k,k1 int
	var str string
	fmt.Scanln(&n)
	fmt.Scanln(&str)
	for _,i:=range str{
		if i=='A'{
			k++
		}else{
			k1++
		}
	}
	if k>k1{
		fmt.Println("Anton")
	}
	if k1>k{
		fmt.Println("Danik")
	}
	if k1==k{
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

func main() {
	var (
		s    string
		n, k float64
	)

	fmt.Scan(&n)
	fmt.Scan(&s)
	for _, c := range s {
		if c == 'A' {
			k++
		}
	}

	if k == n/2 {
		fmt.Println("Friendship")
	} else {
		if k > n/2 {
			fmt.Println("Anton")
		} else {
			fmt.Println("Danik")
		}
	}
}

package main

import "fmt"

func main() {
	var (
		s    string
		n, k float64
	)

	fmt.Scan(&n)
	fmt.Scan(&s)
	for _, c := range s {
		if c == 'A' {
			k++
		}
	}

	switch {
	case k == n/2:
		fmt.Println("Friendship")
	case k > n/2:
		fmt.Println("Anton")
	default:
		fmt.Println("Danik")
	}
}

//
// Created by aldair on 21/10/20.
// https://codeforces.com/problemset/problem/734/A
//

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}
func scanf(f string, a ...interface{}) {
	fmt.Fscanf(reader, f, a...)
}

func main() {
	defer writer.Flush()

	var games, anton, danik int
	scanf("%d\n", &games)

	var str string
	scanf("%s\n", &str)
	for i := 0; i < games; i++ {
		if str[i] == 'A' {
			anton++
		} else {
			danik++
		}
	}

	if anton > danik {
		printf("Anton\n")
	} else if anton < danik {
		printf("Danik\n")
	} else {
		printf("Friendship\n")
	}
}

package main

import (
	"strconv"
	"bufio"
	"os"
	"fmt"
)

func main() {
	sc := NewScanner()
	_ = sc.NextInt()
	S := sc.NextLine()
	d := 0
	a := 0
	for _, v := range S {
		if v == 'D' {
			d++
		} else {
			a++
		}
	}
	ans := ""
	if d > a {
		ans = "Danik"
	} else if d < a {
		ans = "Anton"
	} else {
		ans = "Friendship"
	}
	fmt.Println(ans)
}

func max(a int, b int) int {
	if a < b {
		return b
	}
	return a
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
    "bufio"
    "fmt"
    "os"
)

func main() {
    reader := bufio.NewReader(os.Stdin)
    text, _ := reader.ReadString('\n')
    text, _ = reader.ReadString('\n')
    dic := make(map[string]int)
    for i  := range text {
        ch := string(text[i])
        i, ok := dic[ch]
        if(!ok){
            i = 0
            dic[ch] = i
        }
        dic[ch] = i+1
    }

    cA := dic["A"]
    cD := dic["D"]

    if cA > cD {
        fmt.Println("Anton")
    } else if cA < cD {
        fmt.Println("Danik")
    } else {
        fmt.Println("Friendship")
    }

}

package main
import "fmt"

var (
    n int

    str string
)

func main() {

    fmt.Scanln(&n)
    fmt.Scanln(&str)
    count :=0
    for i:=0;i<len(str);i++{
        if str[i]=='A'{
            count++
        }else{
            count--
        }
    }
    if count>0{
        fmt.Println("Anton")
    }else if count<0{
        fmt.Println("Danik")
    }else{
        fmt.Println("Friendship")
    }

}

package main

import(
	"fmt"
)

func main(){
	var n int
	var S string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &S)
	score := 0
	for _, c := range S {
		if c == 'A'{
			score++
		} else {
			score--
		}
	}
	ans := "Friendship"
	if score > 0 {
		ans = "Anton"
	} else if score < 0 {
		ans = "Danik"
	}
	fmt.Print(ans)
}

package main

import(
	"fmt"
)

func main(){
	var n int
	var S string
	fmt.Scan(&n, &S)
	score := 0
	for _, c := range S {
		if c == 'A'{
			score++
		} else {
			score--
		}
	}
	ans := "Friendship"
	if score > 0 {
		ans = "Anton"
	} else if score < 0 {
		ans = "Danik"
	}
	fmt.Print(ans)
}

package main

import (
	"fmt"
	"os"
)

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	var n,d float64
	var m string
	scanf("%f \n",&n)
	scanf("%s \n",&m)

	for i := 0; i < len(m); i++ {
		if m[i] == 'D' {
			d++
		}
	}

	if d == (n/2) {
		printf("Friendship")
	}else if d > (n/2){
		printf("Danik")
	}else {
		printf("Anton")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()

	var a, an, da int
	scanf("%d \n", &a)
	n := ""
	scanf("%s", &n)
	for _, v := range n {
		if v == 'A' {
			an++
		} else {
			da++
		}
	}
	if an > da {
		printf("Anton\n")
	} else if da > an {
		printf("Danik\n")
	} else {
		printf("Friendship\n")
	}
}

package main

import (
	"fmt"
	//"math"
	"strings"
)

func main() {

	var s string

	var n int

	fmt.Scan(&n, &s)

	countA := len(strings.Replace(s,"D","",-1))
	countD := len(strings.Replace(s,"A","",-1))
	if  countA == countD {
		fmt.Print("Friendship")
	} else {
		if  countA < countD {
			fmt.Print("Danik")
		} else {
			fmt.Print("Anton")
		}
	}

}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func main() {
	var n, anton, danik int
	fmt.Scanf("%d\n", &n)

	r := bufio.NewReader(os.Stdin)

	for i := 0; i < n; i++ {
		c, _, err := r.ReadRune()
		if err == io.EOF {
			break
		} else if err != nil {
			fmt.Fprintf(os.Stderr, "failed to read character from standard input: %v", err)
			os.Exit(1)
		}

		switch c {
		case 'A':
			anton++
		case 'D':
			danik++
		}
	}

	if anton > danik {
		fmt.Println("Anton")
	} else if danik > anton {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import "fmt"

// https://codeforces.com/problemset/problem/734/A
// A. Anton and Danik
// time limit per test
// 1 second
// memory limit per test
// 256 megabytes
// input
// standard input
// output
// standard output

// Anton likes to play chess, and so does his friend Danik.

// Once they have played n games in a row. For each game it's known who was the winner — Anton or Danik. None of the games ended with a tie.

// Now Anton wonders, who won more games, he or Danik? Help him determine this.
// Input

// The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) — the number of games played.

// The second line contains a string s, consisting of n uppercase English letters 'A' and 'D' — the outcome of each of the games. The i-th character of the string is equal to 'A' if the Anton won the i-th game and 'D' if Danik won the i-th game.
// Output

// If Anton won more games than Danik, print "Anton" (without quotes) in the only line of the output.

// If Danik won more games than Anton, print "Danik" (without quotes) in the only line of the output.

// If Anton and Danik won the same number of games, print "Friendship" (without quotes).

func main() {
	var n int
	fmt.Scan(&n)

	var games string
	fmt.Scan(&games)

	var antonWon, danikWon int
	for _, c := range games {
		if c == 'A' {
			antonWon++
		} else {
			danikWon++
		}
	}
	if antonWon > danikWon {
		fmt.Print("Anton")
	} else if danikWon > antonWon {
		fmt.Print("Danik")
	} else {
		fmt.Print("Friendship")
	}
}

package main

// https://codeforces.com/problemset/problem/734/A

import (
	"fmt"
	"io/ioutil"
	"os"
)

func taskSolution(a []byte) string {
	antonWinRate := 0
	for _, b := range a {
		if b == 'A' {
			antonWinRate += 1
		} else if b == 'D' {
			antonWinRate -= 1
		}
	}

	if antonWinRate > 0 {
		return "Anton"
	} else if antonWinRate < 0 {
		return "Danik"
	} else {
		return "Friendship"
	}
}

func main() {
	var n int
	if _, err := fmt.Scan(&n); err != nil {
		panic(err)
	}

	inRaw, err := ioutil.ReadAll(os.Stdin)
	if err != nil {
		panic(err)
	}

	fmt.Println(taskSolution(inRaw))
}

package main
import (
    "bufio"
    "fmt"
    "os"
)
func main(){
  var j int
   fmt.Scanf("%d\n", &j)
  reader := bufio.NewReader(os.Stdin)
   s, _ := reader.ReadString('\n')
   a:=0
   d:=0
   for i:=0;i<j;i++{
     if(s[i]=='A'){
     a++
   }
     if(s[i]=='D'){
     d++
   }
 }
     if(a>d){
       fmt.Println("Anton")
       return
     }
     if(d>a){
       fmt.Println("Danik")
       return
     }
     fmt.Println("Friendship")

}

package main

import "fmt"

func main() {
	var numberOfGames int
	fmt.Scan(&numberOfGames)
	var outcomeString string
	fmt.Scan(&outcomeString)
	var antonWin int
	var danikWin int

	for index := 0; index < numberOfGames; index++ {
		if outcomeString[index] == 'A' {
			antonWin = antonWin + 1
		} else {
			danikWin = danikWin + 1
		}
	}
	if antonWin > danikWin {
		fmt.Printf("Anton")
	} else if antonWin < danikWin {
		fmt.Printf("Danik")
	} else {
		fmt.Printf("Friendship")
	}
}

package main

import "fmt"

func main() {
	var n, m int
	var c byte

	fmt.Scan(&n)
	fmt.Scanf("%c", &c)

	for m = 0; n > 0; n-- {
		fmt.Scanf("%c", &c)
		if c == 'A' {
			m++
		} else {
			m--
		}
	}

	switch {
	case m > 0:
		fmt.Println("Anton")
	case m < 0:
		fmt.Println("Danik")
	default:
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var res string

	fmt.Scanln(&n)
	fmt.Scanln(&res)

	ct := 0
	for i := 0; i < n; i++ {
		if res[i] == 'A' {
			ct++
		}
	}

	remain := n - ct
	if ct < remain {
		fmt.Println("Danik")
	} else if ct == remain {
		fmt.Println("Friendship")
	} else {
		fmt.Println("Anton")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func I(i interface{}, delim string) error {
	_, err := fmt.Fscanf(r, "%v"+delim, i)
	return err
}

func O(o interface{}, delim string) {
	fmt.Fprintf(w, "%v"+delim, o)
}

var (
	r *bufio.Reader
	w *bufio.Writer
)

func init() {
	if f, err := os.Open("in.txt"); err == nil {
		r = bufio.NewReader(f)
	} else {
		r = bufio.NewReader(os.Stdin)
	}
	w = bufio.NewWriter(os.Stdout)
}

func main() {
	defer w.Flush()
	var n int
	for I(&n, "\n") == nil {
		solve()
	}
}

func solve() {
	var s string
	I(&s, "\n")
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		O("Anton", "\n")
	} else if a < d {
		O("Danik", "\n")
	} else {
		O("Friendship", "\n")
	}
}

package main

import (
	"fmt"
)

func main() {
	var cnt, cnt1, n int
	var st string

	fmt.Scanln(&n)
	fmt.Scanln(&st)

	for _, y := range st {
		if string(y) == "A" {
			cnt++
		} else {
			cnt1++
		}
	}

	if cnt > cnt1 {
		fmt.Println("Anton")
	} else if cnt1 > cnt {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	//"math"
)

func solve() {
	_, s := readInt(), readString()
	a, d := strings.Count(s, "A"), strings.Count(s, "D")
	ans := "Friendship"
	switch {
	case a > d:
		ans = "Anton"
	case a < d:
		ans = "Danik"
	}
	fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
    const MaxTokenLength = 1024 * 1024;
    scanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
    scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import "fmt"

func main() {
	var n int
	var input string
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &input)
	countA := 0
	countD := 0
	for _, v := range input {
		if v == 'A' {
			countA++
		} else {
			countD++
		}
	}
	if countA > countD {
		fmt.Println("Anton")
	} else if countA < countD {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
	var num int32
	scanf("%d\n", &num)
	var xstring string
	scanf("%s\n", &xstring)
	temp := strings.Split(xstring, "")
	var a, d, i int = 0, 0, 0
	for i = 0; i < len(temp); i++ {
		if temp[i] == "A" {
			a++
		} else {
			d++
		}
	}
	if a > d {
		fmt.Println("Anton")
	} else if a < d {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var num int32
	_, _ = fmt.Scanln(&num)
	var xstring string
	_, _ = fmt.Scanln(&xstring)
	temp := strings.Split(xstring,"")
	a := 0
	d := 0
	for i:=0;i<len(temp); i++ {
		if temp[i] == "A"{
			a++
		} else {
			d++
		}
	}
	if a>d {
		fmt.Println("Anton")
	} else if a<d {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

// A. Anton and Danik
/*
Anton likes to play chess, and so does his friend Danik.

Once they have played n games in a row. For each game it's known who was the
winner — Anton or Danik. None of the games ended with a tie.

Now Anton wonders, who won more games, he or Danik? Help him determine this.

Input
The first line of the input contains a single integer n (1 ≤ n ≤ 100 000) —
the number of games played.

The second line contains a string s, consisting of n uppercase English letters
'A' and 'D' — the outcome of each of the games. The i-th character of the
string is equal to 'A' if the Anton won the i-th game and 'D' if Danik won
the i-th game.

Output
If Anton won more games than Danik, print "Anton" (without quotes) in the
only line of the output.

If Danik won more games than Anton, print "Danik" (without quotes) in the
only line of the output.

If Anton and Danik won the same number of games, print "Friendship"
(without quotes).

Examples
Input
6
ADAAAA

Output
Anton

Input
7
DDDAADA

Output
Danik

Input
6
DADADA

Output
Friendship

Note
In the first sample, Anton won 6 games, while Danik — only 1. Hence, the
answer is "Anton".

In the second sample, Anton won 3 games and Danik won 4 games, so the
answer is "Danik".

In the third sample, both Anton and Danik won 3 games and the answer is
"Friendship".
*/
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	_, _ = reader.ReadString('\n')

	input2, _ := reader.ReadString('\n')
	s := strings.TrimSpace(input2)

	anton, danik := 0, 0
	for _, v := range s {
		if v == 'A' {
			anton++
		} else {
			danik++
		}
	}

	if anton == danik {
		fmt.Print("Friendship")
	} else if anton > danik {
		fmt.Print("Anton")
	} else {
		fmt.Print("Danik")
	}
}

package main
import (
	"fmt"
	"strings"
)

func main() {
	var input string
	var n int
	fmt.Scan(&n, &input)
	A := strings.Count(input,"A")
	D := strings.Count(input,"D")
	if A > D {
		fmt.Println("Anton")
	} else if A < D {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var bufin *bufio.Reader
var bufout *bufio.Writer

func main() {
	bufin = bufio.NewReader(os.Stdin)
	bufout = bufio.NewWriter(os.Stdout)
	defer bufout.Flush()

	var n int
	var s string
	fmt.Fscanf(bufin, "%d\n", &n)
	fmt.Fscanf(bufin, "%s\n", &s)

	anton := 0
	danik := 0
	for i := 0; i < n; i++ {
		if s[i] == 'A' {
			anton++
		} else {
			danik++
		}
	}

	if anton > danik {
		fmt.Fprintf(bufout, "Anton\n")
	} else if anton < danik {
		fmt.Fprintf(bufout, "Danik\n")
	} else {
		fmt.Fprintf(bufout, "Friendship\n")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]byte, 0, 1000000), 1000000)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := N - A

	if A == D {
		fmt.Println("Friendship")
	} else if A < D {
		fmt.Println("Danik")
	} else if A > D {
		fmt.Println("Anton")
	}

}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d\n", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)

	A := 0
	D := 0
	for _, v := range game {
		if v == 'A' {
			A++
		} else {
			D++
		}
	}
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d\n", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else if v == 'D' {
			D++
		}
	}
	if A == D {
		ostring("Friendship")
		p()
		return
	}
	if A < D {
		ostring("Danik")
		p()
		return
	}
	if A > D {
		ostring("Anton")
		p()
		return
	}
}

package main

import (
	"fmt"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d\n", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)

	A := int32(strings.Count(game, "A"))
	D := N - A
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import(
    "fmt"
)

func main(){
    var(
        n int
        s string
        m = make(map[byte]int)
    )
    fmt.Scan(&n,&s)
    for i:=0;i<n;i++{
        m[s[i]]++
    }
    if m[65] > m[68]{
        fmt.Println("Anton")
    }else if m[65] < m[68]{
        fmt.Println("Danik")
    }else{
        fmt.Println("Friendship")
    }
}

package main

import (
	"fmt"
)

func main() {
	var n, anton, danik int
	anton, danik = 0, 0
	var str string
	_, _ = fmt.Scan(&n, &str)
	for i := 0; i < n; i++ {
		if str[i] == 'A' {
			anton ++
		} else {
			danik++
		}
	}
	if anton > danik{
		fmt.Println("Anton")
	} else if anton < danik {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d\n%s\n", &n, &s)

	games := []rune(s)
	a := 0
	for i := 0; i < n; i++ {
		if games[i] == 'A' {
			a++
			if a > n-a {
				fmt.Println("Anton")
				return
			}
		}
	}

	if a < n-a {
		fmt.Println("Danik")
		return
	}

	fmt.Println("Friendship")
}

package main

import "fmt"

func main() {
	var (
		n int
		s string
	)
	fmt.Scan(&n, &s)

	b2i := map[bool]int8{false: 0, true: 1}
	anton := 0
	for i := range s {
		anton += []int{-1, 1}[b2i[s[i] == 'A']]
	}
	fmt.Println([]string{"Danik", "Friendship", "Anton"}[1+sign(anton)])
}

func sign(a int) int {
	if a == 0 {
		return 0
	} else if a > 0 {
		return 1
	}
	return -1
}

package main

import "fmt"

func main() {
	var n int
	var games string
	var anton int
	var danik int

	fmt.Scan(&n)
	fmt.Scan(&games)

	for _, r := range games {
		switch r {
		case 'A':
			anton++
		case 'D':
			danik++
		}
	}
	if anton > danik {
		fmt.Println("Anton")
	} else if danik > anton {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import (
	"fmt"
)

func main() {

	var a, d int

	x := 0
	st := ""
	fmt.Scan(&x, &st)

	for i := 0; i < len(st); i++ {
		if st[i] == 'A' {
			a++
		} else {
			d++
		}
	}
	if a == d {
		fmt.Println("Friendship")
	} else if a > d {
		fmt.Println("Anton")
	} else {
		fmt.Println("Danik")
	}
}

package main

import (
  "fmt"
  "strings"
)

func main() {
  var n string
  var s int
  fmt.Scan(&s,&n)
  if strings.Count(n,"A") < strings.Count(n, "D") {
    fmt.Print("Danik")
  } else if strings.Count(n,"A") > strings.Count(n, "D"){
    fmt.Print("Anton")
  } else {
    fmt.Print("Friendship")
  }
}

package main

import (
	"fmt"
)

func main() {
	var a int
	A := 0
	D := 0

	fmt.Scanln(&a)

	var inp string
	fmt.Scan(&inp)

	for _, char := range inp {
		charNew := string(char)

		if charNew == "A" {
			A++
		} else {
			D++
		}
	}

	if A > D {
		fmt.Println("Anton")
	} else if A < D {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

// https://codeforces.com/problemset/problem/734/A
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var n int
	fmt.Fscanf(in, "%d\n", &n)
	var s string
	fmt.Fscanf(in, "%s\n", &s)

	a := strings.Count(s, "A")
	d := strings.Count(s, "D")

	if a > d {
		fmt.Fprintln(out, "Anton")
	} else if a < d {
		fmt.Fprintln(out, "Danik")
	} else {
		fmt.Fprintln(out, "Friendship")
	}
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a, d := strings.Count(s, "A"), strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var n int
	var in string
	fmt.Scan(&n, &in)
	fmt.Println(do(in))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	mid := float32(a) / float32(len(s))
	if mid > 0.5 {
		return "Anton"
	}
	if mid < 0.5 {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var s string
	var n int
	fmt.Scan(&n, &s)
	fmt.Println(do(s))
}

package main

import (
	"fmt"
	"strings"
)

func do(n int, s string) string {
	a := strings.Count(s, "A")
	mid := float32(a) / float32(n)
	if mid > 0.5 {
		return "Anton"
	}
	if mid < 0.5 {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var s string
	var n int
	fmt.Scan(&n, &s)
	fmt.Println(do(n, s))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	} else if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var n int
	var in string
	fmt.Scan(&n, &in)
	fmt.Println(do(in))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)
	fmt.Println(do(s))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var in string
	var n int
	fmt.Scan(&n, &in)
	fmt.Println(do(in))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var s string
	var n int
	fmt.Scan(&n, &s)
	fmt.Println(do(s))
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var n int
	var in string
	fmt.Scan(&n, &in)
	fmt.Println(do(in))
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	var n int
	fmt.Scanf("%d \n", &n)
	// string
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')

	result := "Friendship"
	if strings.Count(text, "D") > strings.Count(text, "A") {
		result = "Danik"
	}
	if strings.Count(text, "A") > strings.Count(text, "D") {
		result = "Anton"
	}
	fmt.Println(result)
}

package main

import "fmt"

func main() {
	var n int
	var games string
	var anton, danik int = 0, 0

	fmt.Scanln(&n)
	fmt.Scanln(&games)

	for _, game := range games {
		if game == 'A' {
			anton++
		} else {
			danik++
		}
	}

	if anton > danik {
		fmt.Println("Anton")
	} else if danik > anton {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

func main() {
	var (
		s    string
		n	 int
	)
	fmt.Scan(&n)
	fmt.Scan(&s)
	n = 0
	for _, c := range s {
		if c == 'A' {
			n++
		}else{
			n--
		}
	}
	if n>0 {
		fmt.Println("Anton")
	}else if n<0 {
		fmt.Println("Danik")
	}else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%v\n", &n)
	var winners string
	fmt.Scanf("%v\n", &winners)
	// fmt.Println(n)
	// fmt.Println(winners)
	var nAnton int
	var nDanik int
	for _, winner := range winners {
		// fmt.Println(string(winner))
		if string(winner) == "A" {
			nAnton += 1
		} else {
			nDanik += 1
		}
	}
	if nAnton > nDanik {
		fmt.Println("Anton")
	} else if nAnton < nDanik {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strings"
)

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 1024 * 1024)
	n := 0
	fmt.Sscanf("%d", readLine(reader), &n)
	_ = n
	row := readLine(reader)
	a := 0
	d := 0
	for _, c := range row {
		if string(c) == "A" {
			a++
		} else {
			d++
		}
	}
	if a == d {
		fmt.Println("Friendship")
	}
	if a > d {
		fmt.Println("Anton")
	} else if a < d {
		fmt.Println("Danik")
	}
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}

package main

import "fmt"

// import "strings"

func main() {
	var n int
	fmt.Scan(&n)

	var s string
	fmt.Scan(&s)

	var sumA int
	var sumB int
	sumA = 0
	sumB = 0
	for i := 0; i < n; i++ {
		if s[i] == 'A' {
			sumA += 1
		} else {
			sumB += 1
		}
	}
	if sumA > sumB {
		fmt.Println("Anton")
	} else if sumA < sumB {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import "fmt"

func winner(n int, str string) string {
	var A int = 0
	var D int = 0
	for i := 0; i < n; i++ {
		if string(str[i]) == "A" {
			A += 1
		} else if string(str[i]) == "D" {
			D += 1
		}
	}
	if A > D {
		return "Anton"
	} else if A < D {
		return "Danik"
	} else {
		return "Friendship"
	}
}

func main() {
	var n int
	var str string
	fmt.Scan(&n)
	fmt.Scan(&str)
	fmt.Print(winner(n, str))
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	maxTokenSize := 100 * 1024
	buf := make([]byte, maxTokenSize)
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(buf, maxTokenSize)
	scanner.Scan()
	scanner.Scan()

	var a, d int

	for _, r := range []rune(scanner.Text()) {
		switch r {
		case 'A':
			a++
		case 'D':
			d++
		default:
			break
		}
	}

	switch {
	case a == d:
		fmt.Println("Friendship")
	case a > d:
		fmt.Println("Anton")
	case a < d:
		fmt.Println("Danik")
	}
}

package main

import (
	"fmt"
)

func main() {
	var s string
	var n int
	anton := 0
	danik := 0
	fmt.Scanf("%d\n", &n)
	fmt.Scanf("%s\n", &s)
	for i := 0; i < len(s); i++ {
		tmp := s[i]

		if tmp == 'A' {
			anton += 1
		}else if tmp == 'D'{
			danik += 1
		}

	}
	if anton > danik {
		fmt.Println("Anton")
	}else if anton < danik{
		fmt.Println("Danik")
	}else {
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

func winner(n int, str string) string {
	var anton int = 0
	var danik int = 0
	for i := 0; i < n; i++ {
		if string(str[i]) == "A" {
			anton += 1
		} else if string(str[i]) == "D" {
			danik += 1
		}
	}
	if anton > danik {
		return "Anton"
	} else if anton < danik {
		return "Danik"
	} else {
		return "Friendship"
	}
}

func main() {
	var n int
	var str string
	fmt.Scan(&n)
	fmt.Scan(&str)
	fmt.Print(winner(n, str))
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	var input string
	fmt.Scan(&input)
	// aCount := strings.Count(input, "A")
	// dCount := (n - aCount)

	aCount, dCount := 0, 0

	for i := 0; i < n; i++ {
		if string(input[i]) == "A" {
			aCount++
			continue
		}
		dCount++
	}

	if aCount > dCount {
		fmt.Println("Anton")
	} else if dCount > aCount {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&n)

	var input string
	fmt.Scan(&input)
	aCount := strings.Count(input, "A")
	dCount := (n - aCount)
	if aCount > dCount {
		fmt.Println("Anton")
	} else if dCount > aCount {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

func main ()  {
	var n, anton, danik int
	var c string
	fmt.Scan(&n)
	fmt.Scan(&c)
	for i := 0; i < n; i ++ {
		if c[i] == 'A' {
			anton ++
		} else {
			danik ++
		}
	}
	if anton > danik {
		fmt.Println("Anton")
	} else if anton < danik {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

const nameAnton = "Anton"
const nameDanik = "Danik"
const nameFriendship = "Friendship"

func main() {
	var inputLength int
	var inputData string

	fmt.Scanln(&inputLength)
	fmt.Scanln(&inputData)

	var dCounter int
	var aCounter int

	for _, v := range(inputData) {
		if v == 'D' {
			dCounter++
		} else {
			aCounter++
		}
	}

	if dCounter > aCounter {
		fmt.Println(nameDanik)
	} else if dCounter < aCounter {
		fmt.Println(nameAnton)
	} else {
		fmt.Println(nameFriendship)
	}
}

package main

import "fmt"

const nameAnton = "Anton"
const nameDanik = "Danik"
const nameFriendship = "Friendship"

func main() {
	var inputLength int
	var inputData string

	fmt.Scanln(&inputLength)
	fmt.Scanln(&inputData)

	var dCounter int

	for _, v := range(inputData) {
		if v == 'D' {
			dCounter++
		}
	}

	if float64(dCounter) / float64(inputLength) > 0.5 {
		fmt.Println(nameDanik)
	} else if float64(dCounter) / float64(inputLength) < 0.5 {
		fmt.Println(nameAnton)
	} else {
		fmt.Println(nameFriendship)
	}
}

package main

import "fmt"

func main() {
	var n int
	var x string
	fmt.Scanf("%d\n%s", &n, &x)
	a := 0
	d := 0

	for i := 0; i < n; i++ {
		if string(x[i]) == "A" {
			a++
		} else {
			d++
		}
	}

	if a > d {
		fmt.Println("Anton")
	} else if a < d {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var n int
var s string

func main() {
	stdin := os.Stdin
	// stdin, _ = os.Open("1.in")
	reader := bufio.NewReaderSize(stdin, 1<<20)
	fmt.Fscanf(reader, "%d\n%s", &n, &s)

	var a, d int
	for i := 0; i < n; i++ {
		if s[i] == 'A' {
			a++
		} else {
			d++
		}
	}
	if a > d {
		fmt.Println("Anton")
	} else if a < d {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	in := bufio.NewReader(os.Stdin)
	var n uint32
	var s string
	a := 0
	d := 0
	fmt.Fscanf(in, "%d\n", &n)
	fmt.Fscanf(in, "%s\n", &s)
	for i := 0; uint32(i) < n; i++ {
		if s[i] == 65 {
			a++
		} else if s[i] == 68 {
			d++
		}
	}
	if a > d {
		fmt.Println("Anton")
	} else if d > a {
		fmt.Println("Danik")
	} else if a == d {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var N int
	var S string
	fmt.Scanf("%d\n",&N)
	fmt.Scanf("%s",&S)
	arr := string([]rune(S))
	var aC,dC int
	for i := 0 ; i < N ; i++{
		if arr[i] == 65 {
			aC += 1
		}else if arr[i] == 68{
			dC += 1
		}
	}
	if aC < dC{
		fmt.Println("Danik")
	}else if dC < aC{
		fmt.Println("Anton")
	}else{
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
	"io"
	"os"
)

func cf734a(in io.Reader, out io.Writer) {
	var a string
	var n, Awins, Dwins int
	fmt.Fscan(in, &n)
	fmt.Fscan(in, &a)
	runes := []rune(a)
	for i := 0; i < len(runes); i++ {
		if runes[i] == 'A' {
			Awins++
		}
		if runes[i] == 'D' {
			Dwins++
		}
	}
	// fmt.Println(Awins)
	// fmt.Println(Dwins)

	if Awins > Dwins {
		fmt.Println("Anton")
	} else if Awins < Dwins {
		fmt.Println("Danik")
	} else if Awins == Dwins {
		fmt.Println("Friendship")

	}

}

func main() { cf734a(os.Stdin, os.Stdout) }

package main

import "fmt"

func find_winner(game int, winner string) string {
	var anton_won, danik_won int = 0, 0
	for i := 0; i < game; i++ {
		if string(winner[i]) == "A" {
			anton_won += 1
		} else if string(winner[i]) == "D" {
			danik_won += 1
		}
	}
	if anton_won > danik_won {
		return "Anton"
	} else if anton_won < danik_won {
		return "Danik"
	} else {
		return "Friendship"
	}
}

func main() {
	var game int
	fmt.Scan(&game)
	var winner string
	fmt.Scan(&winner)
	fmt.Print(find_winner(game, winner))
}

package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scanf("%d", &n)
	//reader := bufio.NewReader(os.Stdin)
	//s, _ := reader.ReadString('\n')
	fmt.Scan(&s)
	//fmt.Scanf(&s)

	countA := 0
	countD := 0
	for i := 0; i < n; i++ {
		if s[i] == 'A' {
			countA++
		} else {
			countD++
		}
	}
	if countA > countD {
		fmt.Println("Anton")
	} else if countA < countD {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

// ░░░░░░░░░░░░░░░SPINDYZEL░░░░░░░░░░░░░░░
// ░░░░░░░░░░▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄░░░░░░░░░
// ░░░░░░░░▄▀░░░░░░░░░░░░▄░░░░░░░▀▄░░░░░░░
// ░░░░░░░░█░░░░░░░░░░░░▄█▄▄░░▄░░░█░▄▄▄░░░
// ░▄▄▄▄▄░░█░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██░░
// ░██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██░░
// ░░▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██░
// ░░░░▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██░
// ░░░░░░░▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██░
// ░░░░░░░▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀░░
// ░░░░░░█▀▀█████████▀▀▀▀████████████▀░░░░
// ░░░░░░████▀░░███▀░░░░░░▀███░░▀██▀░░░░░░

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		fmt.Println("Anton")
	} else if a < d {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

// 6
// ADAAAA
func main() {
	var counter [2]int
	var n int
	fmt.Scanln(&n)
	var ch rune
	for i := 0; i < n; i++ {
		fmt.Scanf("%c", &ch)
		if ch == 'A' {
			counter[0]++
		} else {
			counter[1]++
		}
	}
	if counter[0] > counter[1] {
		fmt.Println("Anton")
	} else if counter[0] < counter[1] {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
	"fmt"
)

func main() {
	var (
		n int
		s string
		a int
		d int
	)

	fmt.Scan(&n, &s)

	for i := 0; i < n; i++ {
		if s[i] == 'A' {
			a++
		} else {
			d++
		}
	}

	if a > d {
		fmt.Println("Anton")
	} else if d > a {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main

import (
    "fmt"
)

func main() {
    var n int
    fmt.Scanln(&n)
    var games string
    fmt.Scanln(&games)

    var half float32
    half = float32(n) / 2.0
    var a_win_counter float32 = 0
    for _, v := range games {
        if v == 'A' {
            a_win_counter++
        }
        if a_win_counter > half {
            break
        }
    }
    if a_win_counter > half {
        fmt.Println("Anton")
    } else if a_win_counter < half {
        fmt.Println("Danik")
    } else {
        fmt.Println("Friendship")
    }
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func Readln(r *bufio.Reader) (string, error) {
	var (
		isPrefix bool  = true
		err      error = nil
		line, ln []byte
	)
	for isPrefix && err == nil {
		line, isPrefix, err = r.ReadLine()
		ln = append(ln, line...)
	}
	return string(ln), err
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	line, _ := Readln(reader)
	count, _ := strconv.Atoi(line)

	line, _ = Readln(reader)

	nAnton := 0
	for i := 0; i < count; i++ {
		if rune(line[i]) == rune('A') {
			nAnton++
		}
	}

	nDanik := count - nAnton
	if nAnton > nDanik {
		fmt.Println("Anton")
	} else if nAnton < nDanik {
		fmt.Println("Danik")
	} else {
		fmt.Println("Friendship")
	}
}

package main
import (
    "fmt"
)
func main() {
	var a,d,n int
	var s string
	fmt.Scan(&n)
	fmt.Scan(&s)
	for i := 0; i < n; i++ {
	    if s[i] == 'A' {
	        a += 1
	    } else if s[i] == 'D'{
	        d += 1
	    }
	}
	if(a>d){
	    fmt.Println("Anton")
	} else if d > a {
	    fmt.Println("Danik")
	} else if d == a{
	    fmt.Println("Friendship")
	}

}

package main

import (
    "fmt"
)

func main() {
    var n int
    var s string
    fmt.Scan(&n, &s)

    cntA := 0
    for i := 0; i < n; i++ {
        if s[i] == 'A' {
            cntA++
        } else {
            cntA--
        }
    }
    if cntA > 0 {
      fmt.Println("Anton")
      return
    }
    if cntA < 0 {
      fmt.Println("Danik")
      return
    }
    fmt.Println("Friendship")
}

package main

import "fmt"

func main() {
	var n int
	var s string
	fmt.Scan(&n)
	fmt.Scan(&s)
	var a, d int
	for i := 0; i < n; i++ {
		r := s[i]
		fmt.Println(r)
		if r == 'A' {
			a++
		} else if r == 'D' {
			d++
		}
	}
	if a > d {
		fmt.Print("Anton")
	} else if a < d {
		fmt.Print("Danik")
	} else {
		fmt.Print("Friendship")
	}
}

package main

import (
	"strconv"
	"bufio"
	"os"
	"fmt"
)

func main() {
	sc := NewScanner()
	_ = sc.NextInt()
	S := sc.NextLine()
	d := 0
	a := 0
	for v := range S {
		if v == 'D' {
			d++
		} else {
			a++
		}
	}
	ans := ""
	if d > a {
		ans = "Danik"
	} else if d < a {
		ans = "Anton"
	} else {
		ans = "Friendship"
	}
	fmt.Println(ans)
}

func max(a int, b int) int {
	if a < b {
		return b
	}
	return a
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r:rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf) + 1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

package main

import (
	"fmt"
	"os"
)

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	var n int
	var m string
	scanf("%d \n",&n)
	scanf("%s \n",&m)

	d := 0
	for i := 0; i < len(m); i++ {
		if m[i] == 'D' {
			d++
		}
	}

	if n < 2 || d == (n/2) {
		printf("Friendship")
	}else if d > (n/2){
		printf("Danik")
	}else {
		printf("Anton")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var str string
	scanf("%d \n",&n)
	scanf("%s \n",&str)

	d := 0
	for i := 0; i < len(str); i++ {
		if str[i] == 'D' {
			d++
		}
	}

	if n < 2 || d == (n/2) {
		printf("Friendship")
	}else if d > (n/2){
		printf("Danik")
	}else {
		printf("Anton")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func check(e error) {
	if e != nil {
		panic(e)
	}
}

func main() {
	var n int
	var m string
	scanf("%d \n",&n)
	scanf("%s \n",&m)

	d := 0
	for i := 0; i < len(m); i++ {
		if m[i] == 'D' {
			d++
		}
	}
	if d > (n/2){
		printf("Danik")
	}else if d < (n/2) {
		printf("Anton")
	}else {
		printf("Friendship")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var str string
	scanf("%d \n",&n)
	scanf("%s \n",&str)

	d := 0
	for i := 0; i < len(str); i++ {
		if str[i] == 'D' {
			d++
		}
	}

	if n > 1 || d == (n/2) {
		printf("Friendship")
	}else if d > (n/2){
		printf("Danik")
	}else {
		printf("Anton")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"fmt"
	"os"
)

func main() {
	var n int
	var m string
	scanf("%d \n",&n)
	scanf("%s \n",&m)

	d := 0
	for i := 0; i < len(m); i++ {
		if m[i] == 'D' {
			d++
		}
	}

	if n < 2 || d == (n/2) {
		printf("Friendship")
	}else if d > (n/2){
		printf("Danik")
	}else {
		printf("Anton")
	}
}

func printf(format string, x ...interface{}) {
	fmt.Fprintf(os.Stdout, format, x...)
}

func scanf(format string, x ...interface{}) {
	if _, err := fmt.Fscanf(os.Stdin, format, x...); err != nil {
		panic(err)
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
)

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func main() {
	// STDOUT MUST BE FLUSHED MANUALLY!!!
	defer writer.Flush()

	var a, an, da int
	scanf("%d \n", &a)
	n := ""
	scanf("%s", &n)
	for _, v := range n {
		if v == 'A' {
			an++
		} else {
			da++
		}
	}
	if an > da {
		println("Anton")
	} else if da > an {
		println("Danik")
	} else {
		println("Friendship")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	//"math"
)

func solve() {
	n, s := readInt(), readString()
    if len(s) != n {
        fmt.Println(len(s))
    }
	a, d := strings.Count(s, "A"), strings.Count(s, "D")
	ans := "Friendship"
	switch {
	case a > d:
		ans = "Anton"
	case a < d:
		ans = "Danik"
	}
	fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	//"math"
)

func solve() {
	_, s := readInt(), readString()
	a, d := strings.Count(s, "A"), strings.Count(s, "D")
	ans := "Friendship"
	switch {
	case a > d:
		ans = "Anton"
	case a < d:
		ans = "Danik"
	}
	fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
	//"math"
)

func solve() {
	_, s := readInt(), readString()
	a, d := strings.Count(s, "A"), strings.Count(s, "B")
	ans := "Friendship"
	switch {
	case a > d:
		ans = "Anton"
	case a < d:
		ans = "Danik"
	}
	fmt.Println(ans)
}

var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func main() {
	scanner.Split(bufio.ScanWords)
	solve()
}

// Math
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func min(x, y int) int {
	return x + y - max(x, y)
}

// IO

func readString() string {
	scanner.Scan()
	return scanner.Text()
}

func readInt() int {
	val, _ := strconv.Atoi(readString())
	return val
}

func readIntArray(sz int) []int {
	a := make([]int, sz)
	for i := 0; i < sz; i++ {
		a[i] = readInt()
	}
	return a
}

func readArray(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = readInt()
	}
	return res
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else {
			D++
		}
	}
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d\n", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	fmt.Println(N, game)
	return
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else if v == 'D' {
			D++
		}
	}
	if A == D {
		ostring("Friendship")
		p()
		return
	}
	if A < D {
		ostring("Danik")
		p()
		return
	}
	if A > D {
		ostring("Anton")
		p()
		return
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else {
			D++
		}
	}
	oi32c(int32(A), " ")
	oi32n(int32(D))
	p()
	return
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := N - A
	if A == D {
		fmt.Println("Friendship")
	} else if A < D {
		fmt.Println("Danik")
	} else if A > D {
		fmt.Println("Anton")
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else if v == 'D' {
			D++
		}
	}
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else if v == 'D' {
			D++
		}
	}
	if A == D {
		ostring("Friendship")
		p()
		return
	}
	if A < D {
		ostring("Danik")
		p()
		return
	}
	if A > D {
		ostring("Anton")
		p()
		return
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := strings.Count(S, "D")
	if strings.Index(S, "DADAAAAA") == 0 {
		fmt.Println(N, A, D, A+D)
		return
	} else {

		if A == D {
			fmt.Println("Friendship")
		} else if A < D {
			fmt.Println("Danik")
		} else if A > D {
			fmt.Println("Anton")
		}
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := strings.Count(S, "D")
	if strings.Index(S, "DADAAAAADDDAAAADA") == 0 {
		fmt.Println(N, A, D, A+D)
	}
	if A == D {
		fmt.Println("Friendship")
	} else if A < D {
		fmt.Println("Danik")
	} else if A > D {
		fmt.Println("Anton")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := N - A
	if A == D {
		fmt.Println("Friendship")
	} else if A < D {
		fmt.Println("Danik")
	} else if D > A {
		fmt.Println("Anton")
	}
}

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	N, _ := strconv.Atoi(scanner.Text())
	scanner.Scan()
	S := scanner.Text()
	A := strings.Count(S, "A")
	D := strings.Count(S, "D")
	if strings.Index(S, "DADAAAAA") == 0 {
		fmt.Println(N, A, D, A+D)
	}
	if A == D {
		fmt.Println("Friendship")
	} else if A < D {
		fmt.Println("Danik")
	} else if A > D {
		fmt.Println("Anton")
	}
}

package main

import "fmt"

// MAX32 is
var MAX32 int32 = 2147483647

// MIN32 is
var MIN32 int32 = -2147483648

// MAX64 is
var MAX64 int64 = 9223372036854775807

// MIN64 is
var MIN64 int64 = -9223372036854775808

func ri32(pn *int32) {
	fmt.Scanf("%d", pn)
}
func rai32(nums int32) []int32 {
	re := make([]int32, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		ri32(&re[idx])
	}
	return re
}
func rstr(ps *string) {
	fmt.Scanf("%s", ps)
}
func rastr(nums int32) []string {
	re := make([]string, nums+1, nums+1)
	for idx := int32(1); idx != nums+1; idx++ {
		rstr(&re[idx])
	}
	return re
}

// OUT is
var OUT string

func oi32(i int32) {
	OUT += fmt.Sprintf("%d", i)
}
func oi64(i int64) {
	OUT += fmt.Sprintf("%d", i)
}

func oi32c(i int32, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}
func oi64c(i int64, c string) {
	OUT += fmt.Sprintf("%d%s", i, c)
}

func oi32n(i int32) {
	oi32c(i, "\n")
}
func oi64n(i int64) {
	oi64c(i, "\n")
}

func oi32space(i int32) {
	oi32c(i, " ")
}
func oi64space(i int64) {
	oi64c(i, " ")
}

func ostring(s string) {
	OUT += s
}
func ob(b byte) {
	OUT += fmt.Sprintf("%c", b)
}

func p() {
	fmt.Print(OUT)
}

//
var game string
var N int32

func main() {
	ri32(&N)
	rstr(&game)
	b := []byte(game)
	A := 0
	D := 0
	for _, v := range b {
		if v == 'A' {
			A++
		} else {
			D++
		}
	}
	fmt.Printf("%s ", b)
	oi32c(int32(A), " ")
	oi32n(int32(D))
	p()
	return
	if A == D {
		ostring("Friendship\n")
		p()
		return
	}
	if A < D {
		ostring("Danik\n")
		p()
		return
	}
	if A > D {
		ostring("Anton\n")
		p()
		return
	}
}

package main

import (
	"fmt"
)

func main() {

	var a, d int

	x := 0
	st := ""
	fmt.Scan(&x, &d)

	for i := 0; i < len(st); i++ {
		if st[i] == 'A' {
			a++
		} else {
			d++
		}
	}
	if a == d {
		fmt.Println("Friendship")
	} else if a > d {
		fmt.Println("Anton")
	} else {
		fmt.Println("Danik")
	}
}

package main

import (
  "fmt"
  "strings"
)

func main() {
  var s string
  var n int
  fmt.Scan(&s,&n)
  if strings.Count(s,"A") < strings.Count(s, "D") {
    fmt.Print("Danik")
  } else if strings.Count(s,"A") > strings.Count(s, "D"){
    fmt.Print("Anton")
  } else {
    fmt.Print("Friendship")
  }
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var in string
	var n int
	fmt.Scan(&n)
	for n > 0 {
		fmt.Scan(&in)
		fmt.Println(do(in))
		n--
	}
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var in string
	fmt.Scan(&in)
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var n int
	var in string
	for n > 0 {
		fmt.Scan(&in)
		do(in)
		n--
	}
}

package main

import (
	"fmt"
	"strings"
)

func do(s string) string {
	a := strings.Count(s, "A")
	d := strings.Count(s, "D")
	if a > d {
		return "Anton"
	}
	if a < d {
		return "Danik"
	}
	return "Friendship"
}

// put the test case here.
// comment this func before
// submitting to codeforces
// func Test(t *testing.T) {
// 	a := assert.New(t)
// 	a.Equal("Anton", do("ADAAAA"))
// 	a.Equal("Danik", do("DDDAADA"))
// 	a.Equal("Friendship", do("DADADA"))
// }

// http://codeforces.com/problemset/problem/734/A
func main() {
	var in string
	var n int
	fmt.Scan(&n)
	for n > 0 {
		fmt.Scan(&in)
		do(in)
		n--
	}
}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%v\n", &n)
	var winners string
	fmt.Scanf("%v\n", &winners)
	fmt.Println(n)
	fmt.Println(winners)
	var nAnton int
	var nDanik int
	for _, winner := range winners {
		fmt.Println(string(winner))
		if string(winner) == "A" {
			nAnton += 1
		} else {
			nDanik += 1
		}
	}
	if nAnton > nDanik {
		fmt.Println("Anton")
	} else {
		fmt.Println("nDanik")
	}

}

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%v\n", &n)
	var winners string
	fmt.Scanf("%v\n", &winners)
	// fmt.Println(n)
	// fmt.Println(winners)
	var nAnton int
	var nDanik int
	for _, winner := range winners {
		// fmt.Println(string(winner))
		if string(winner) == "A" {
			nAnton += 1
		} else {
			nDanik += 1
		}
	}
	if nAnton > nDanik {
		fmt.Println("Anton")
	} else {
		fmt.Println("nDanik")
	}

}

package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	scanner.Scan()

	var a, d int

	for _, r := range []rune(scanner.Text()) {
		switch r {
		case 'A':
			a++
		case 'D':
			d++
		default:
			break
		}
	}

	switch {
	case a == d:
		fmt.Println("Friendship")
	case a > d:
		fmt.Println("Anton")
	case a < d:
		fmt.Println("Danik")
	}
}

package main

import "fmt"

func main(){
	var m map[byte]int
	var n int
	var c byte
	m = make(map[byte]int)

	fmt.Scan(&n)

	for i:=0; i<n ; i++{
		fmt.Scanf("%c",&c)
		m[c]++
		fmt.Println(c," = ",m[c])
	}

	if m['D'] < m['A']{
		fmt.Println("Anton")
	}else if m['D'] > m['A']{
		fmt.Println("Danik")
	}else{
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

func main(){
	var m map[byte]int
	var n int
	var c byte
	m = make(map[byte]int)

	fmt.Scan(&n)

	for i:=0; i<n ; i++{
		fmt.Scanf("%c",&c)
		m[c]++
		//fmt.Println(c," = ",m[c])
	}

	if m['D'] < m['A']{
		fmt.Println("Anton")
	}else if m['D'] > m['A']{
		fmt.Println("Danik")
	}else{
		fmt.Println("Friendship")
	}
}

package main

import "fmt"

const nameAnton = "Anton"
const nameDanik = "Danik"
const nameFriendship = "Friendship"

func main() {
	var inputLength int
	var inputLengthHalf int
	var noFriendship bool
	var inputData string

	fmt.Scanln(&inputLength)
	fmt.Scanln(&inputData)

	inputLengthHalf = inputLength / 2
	noFriendship = inputLength&1 == 1
	var dCounter int

	for _, v := range(inputData) {
		if v == 'D' {
			dCounter++

			if !noFriendship && dCounter == inputLengthHalf {
				fmt.Println(nameFriendship)
				return;
			}

			if dCounter > inputLengthHalf {
				fmt.Println(nameDanik)
				return;
			}
		}
	}

	fmt.Println(nameAnton)
}


package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
)

var in *bufio.Reader
var out *bufio.Writer

func printf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, x, a...)
}

func scanf(x string, a ...interface{}) (n int, err error) {
	return fmt.Fscanf(in, x, a...)
}

func scan(a ...interface{}) (n int, err error) {
	return fmt.Fscan(in, a...)
}

var err error

func next() (n string) {
	scan(&n)
	return n
}

func nextInt() (n int) {
	scan(&n)
	return n
}

func nextLong() (n int64) {
	scan(&n)
	return n
}

func nextDouble() (n float64) {
	scan(&n)
	return n
}

func Max(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func solve() {
	n, _ := nextInt(), nextInt()
	arr := make([]int64, n)

	for i := range arr {
		arr[i] = nextLong()
	}

	var a, b int64 = 0, 0

	for i := 0; i < n; i++ {
		a, b = Max(a, b+arr[i]), Max(b, a-arr[i])
	}

	printf("%d\n", Max(a, b))
}

func main() {
	in = bufio.NewReaderSize(os.Stdin, 8192)
	out = bufio.NewWriterSize(os.Stdout, 8192)
	if false {
		name := "in"
		file1, err := os.Open(name + ".in")
		if err != nil {
			log.Fatal(err)
		}
		file2, err := os.Create(name + ".out")
		if err != nil {
			log.Fatal(err)
		}
		in = bufio.NewReaderSize(file1, 8192)
		out = bufio.NewWriterSize(file2, 8192)
	}
	defer out.Flush()
	// start := time.Now()

	for t, i := nextInt(), 1; t > 0; t, i = t-1, i+1 {
		// printf("Case #%d:\n", i)
		solve()
	}

	// printf("%v\n", time.Now().Sub(start))
}

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

const (
	SCANNER_BUF_SIZE = 2 << 20

	INF = int64(math.MaxInt64)
	MOD = 1e9 + 7
)

var (
	writer  *bufio.Writer
	scanner *bufio.Scanner
)

func init() {
	writer = bufio.NewWriter(os.Stdout)
	scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, SCANNER_BUF_SIZE), SCANNER_BUF_SIZE)
}

func printf(f string, a ...interface{}) {
	fmt.Fprintf(writer, f, a...)
}

func sint64() int64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := int64(0)
	if bb[0] == '-' {
		for _, b := range bb[1:] {
			i *= 10
			i -= int64(b - '0')
		}
		return i
	}
	for _, b := range bb {
		i *= 10
		i += int64(b - '0')
	}
	return i
}

func suint64() uint64 {
	scanner.Scan()
	bb := scanner.Bytes()
	i := uint64(0)
	for _, b := range bb {
		i *= 10
		i += uint64(b - '0')
	}
	return i
}

func sstring() string {
	scanner.Scan()
	return scanner.Text()
}

func gcd(a, b int64) int64 {
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func lcm(a, b int64) int64 {
	return a * b / gcd(a, b)
}

func abs(a int64) int64 {
	if a < 0 {
		return a * -1
	}
	return a
}

func min(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r < a {
			a = r
		}
	}
	return a
}

func max(a int64, rest ...int64) int64 {
	for _, r := range rest {
		if r > a {
			a = r
		}
	}
	return a
}

func main() {
	defer writer.Flush()
	t := sint64()
	for ; t > 0; t-- {
		n := sint64()
		_ = sint64() // q == 0
		a := make([]int64, n)
		for i := range a {
			a[i] = sint64()
		}
		printf("%d\n", sol(n, a))
	}
}

func sol(n int64, a []int64) int64 {
	isInc := true
	prev := a[0]
	ret := int64(0)
	for i := 1; i < len(a); i++ {
		if isInc {
			if a[i] >= prev {
				prev = a[i]
				continue
			}
			ret += prev
			isInc = false
			prev = a[i]
			continue
		}

		if a[i] <= prev {
			prev = a[i]
			continue
		}
		ret -= prev
		isInc = true
		prev = a[i]
	}
	if isInc {
		ret += a[len(a)-1]
	}
	return ret
}

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)

	tc := readNum(reader)
	var buf bytes.Buffer
	for tc > 0 {
		tc--
		n, _ := readTwoNums(reader)
		A := readNNums(reader, n)
		res := solve(n, A)
		buf.WriteString(fmt.Sprintf("%d\n", res))
	}

	fmt.Print(buf.String())
}

func readInt(bytes []byte, from int, val *int) int {
	i := from
	sign := 1
	if bytes[i] == '-' {
		sign = -1
		i++
	}
	tmp := 0
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + int(bytes[i]-'0')
		i++
	}
	*val = tmp * sign
	return i
}

func readNum(reader *bufio.Reader) (a int) {
	bs, _ := reader.ReadBytes('\n')
	readInt(bs, 0, &a)
	return
}

func readTwoNums(reader *bufio.Reader) (a int, b int) {
	res := readNNums(reader, 2)
	a, b = res[0], res[1]
	return
}

func readThreeNums(reader *bufio.Reader) (a int, b int, c int) {
	res := readNNums(reader, 3)
	a, b, c = res[0], res[1], res[2]
	return
}

func readNNums(reader *bufio.Reader, n int) []int {
	res := make([]int, n)
	x := 0
	bs, _ := reader.ReadBytes('\n')
	for i := 0; i < n; i++ {
		for x < len(bs) && (bs[x] < '0' || bs[x] > '9') && bs[x] != '-' {
			x++
		}
		x = readInt(bs, x, &res[i])
	}
	return res
}

func readUint64(bytes []byte, from int, val *uint64) int {
	i := from

	var tmp uint64
	for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
		tmp = tmp*10 + uint64(bytes[i]-'0')
		i++
	}
	*val = tmp

	return i
}

func solve(n int, P []int) int64 {
	var buy int64
	var sell int64

	for i := 0; i < n; i++ {
		cur := int64(P[i])
		buy, sell = max(buy, sell+cur), max(sell, buy-cur)
	}

	return buy
}

func max(a, b int64) int64 {
	if a >= b {
		return a
	}
	return b
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

const INF = int64(1e9)

func main() {
	io := NewFastIO(os.Stdin, os.Stdout)
	defer io.Flush()

	type Data struct {
		pp, pm, mp, mm int64
	}
	makeData := func(x int) Data { return Data{int64(x), -INF, -INF, -int64(x)} }
	def := Data{-INF, -INF, -INF, -INF}
	merge := func(l, r Data) Data {
		return Data{
			max(l.pp, r.pp, l.pp+r.mp, l.pm+r.pp),
			max(l.pm, r.pm, l.pm+r.pm, l.pp+r.mm),
			max(l.mp, r.mp, l.mp+r.mp, l.mm+r.pp),
			max(l.mm, r.mm, l.mm+r.pm, l.mp+r.mm),
		}
	}
	makeSegtree := func(a []int) (set func(i, v int), ans func() int64) {
		n := 1
		for n < len(a) {
			n *= 2
		}
		t := make([]Data, 2*n)
		for i := range t {
			t[i] = def
		}
		for i, x := range a {
			t[n+i] = makeData(x)
		}
		for i := n - 1; i > 0; i-- {
			t[i] = merge(t[i*2], t[i*2+1])
		}
		set = func(i, v int) {
			i += n
			t[i] = makeData(v)
			for i /= 2; i > 0; i /= 2 {
				t[i] = merge(t[i*2], t[i*2+1])
			}
		}
		ans = func() int64 { return max(t[1].pp, t[1].pm, -INF, -INF) }
		return
	}

	for t := io.NextInt(); t > 0; t-- {
		n, q := io.NextInt(), io.NextInt()
		a := io.NextInts(n)
		set, ans := makeSegtree(a)
		io.Println(ans())
		for ; q > 0; q-- {
			l, r := io.NextInt()-1, io.NextInt()-1
			set(l, a[r])
			set(r, a[l])
			a[l], a[r] = a[r], a[l]
			io.Println(ans())
		}
	}
}

func max(a, b, c, d int64) int64 {
	x := a
	if b > x {
		x = b
	}
	if c > x {
		x = c
	}
	if d > x {
		x = d
	}
	return x
}

type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}

package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

const INF = int(1e9)

func main() {
	io := NewFastIO(os.Stdin, os.Stdout)
	defer io.Flush()

	type Data struct {
		pp, pm, mp, mm int
	}
	makeData := func(x int) Data { return Data{x, -INF, -INF, -x} }
	def := Data{-INF, -INF, -INF, -INF}
	merge := func(l, r Data) Data {
		return Data{
			max(l.pp, r.pp, l.pp+r.mp, l.pm+r.pp),
			max(l.pm, r.pm, l.pm+r.pm, l.pp+r.mm),
			max(l.mp, r.mp, l.mp+r.mp, l.mm+r.pp),
			max(l.mm, r.mm, l.mm+r.pm, l.mp+r.mm),
		}
	}
	makeSegtree := func(a []int) (set func(i, v int), ans func() int) {
		n := 1
		for n < len(a) {
			n *= 2
		}
		t := make([]Data, 2*n)
		for i := range t {
			t[i] = def
		}
		for i, x := range a {
			t[n+i] = makeData(x)
		}
		for i := n - 1; i > 0; i-- {
			t[i] = merge(t[i*2], t[i*2+1])
		}
		set = func(i, v int) {
			i += n
			t[i] = makeData(v)
			for i /= 2; i > 0; i /= 2 {
				t[i] = merge(t[i*2], t[i*2+1])
			}
		}
		ans = func() int { return max(t[1].pp, t[1].pm) }
		return
	}

	for t := io.NextInt(); t > 0; t-- {
		n, q := io.NextInt(), io.NextInt()
		a := io.NextInts(n)
		set, ans := makeSegtree(a)
		io.Println(ans())
		for ; q > 0; q-- {
			l, r := io.NextInt()-1, io.NextInt()-1
			set(l, a[r])
			set(r, a[l])
			a[l], a[r] = a[r], a[l]
			io.Println(ans())
		}
	}
}

func max(a ...int) int {
	x := a[0]
	for _, y := range a[1:] {
		if y > x {
			x = y
		}
	}
	return x
}

type FastIO struct {
	*bufio.Writer
	r    io.Reader
	buf  [8192]byte
	i, n int
}

func NewFastIO(r io.Reader, w io.Writer) *FastIO {
	return &FastIO{r: r, Writer: bufio.NewWriter(w)}
}

func (f *FastIO) readC() byte {
	if f.i == f.n {
		f.n, _ = f.r.Read(f.buf[:])
		if f.n == 0 {
			panic("EOF")
		}
		f.i = 0
	}
	f.i++
	return f.buf[f.i-1]
}

func (f *FastIO) NextInt() int {
	c := f.readC()
	for ; c <= ' '; c = f.readC() {
	}
	neg := false
	if c == '-' {
		neg = true
		c = f.readC()
	}
	n := 0
	for ; '0' <= c && c <= '9'; c = f.readC() {
		n = n*10 + int(c) - '0'
	}
	if neg {
		return -n
	}
	return n
}

func (f *FastIO) NextInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = f.NextInt()
	}
	return a
}

func (f *FastIO) Println(a ...interface{}) {
	fmt.Fprintln(f, a...)
}