import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.*;
import java.math.*;
public class Main {
    InputStream is;
    PrintWriter out;
    String INPUT = "";
    //class  Declaration

    static class pair implements Comparable < pair > {
        int x;
        int y;

        pair(int i, int j) {
            x = i;
            y = j;

        }
        public int compareTo(pair p) {
            if (this.x != p.x) {
                return this.x - p.x;
            } else {
                return this.y - p.y;
            }
        }
        public int hashCode() {
            return (x + " " + y).hashCode();
        }
        public String toString() {
            return x + " " + y;
        }
        public boolean equals(Object o) {
            pair x = (pair) o;
            return (x.x == this.x && x.y == this.y);
        }
    }
    // int[] dx = {0,0,1,-1};
    // int[] dy = {1,-1,0,0};
    // int[] ddx = {0,0,1,-1,1,-1,1,-1};
    // int[] ddy = {1,-1,0,0,1,-1,-1,1};

int inf = (int) 1e9 + 5;
long mod = (long)1e9 + 7 ;
void solve() throws Exception {
    int a=ni(),b=ni(),c=ni();
    if(a+b+c>=22) pn("bust");
    else pn("win");
}

    long pow(long a, long b) {
        long result = 1;
        while (b > 0) {
            if (b % 2 == 1) result = (result * a) % mod;
            b /= 2;
            a = (a * a) % mod;
        }
        return result;
    }

    void print(Object o) {
        System.out.println(o);
        System.out.flush();
    }

    long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
        solve();
        out.flush();
        if (!INPUT.isEmpty()) tr(System.currentTimeMillis() - s + "ms");
    }

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    //output methods
    private void pn(Object o) {
        out.println(o);
    }
    private void p(Object o) {
        out.print(o);
    }
    private ArrayList < ArrayList < Integer >> ng(int n, int e) {
        ArrayList < ArrayList < Integer >> g = new ArrayList < > ();
        for (int i = 0; i <= n; ++i) g.add(new ArrayList < > ());

        for (int i = 0; i < e; ++i) {
            int u = ni(), v = ni();
            g.get(u).add(v);
            g.get(v).add(u);
        }

        return g;
    }

    private ArrayList < ArrayList < pair >> nwg(int n, int e) {
        ArrayList < ArrayList < pair >> g = new ArrayList < > ();
        for (int i = 0; i <= n; ++i) g.add(new ArrayList < > ());

        for (int i = 0; i < e; ++i) {
            int u = ni(), v = ni(), w = ni();
            g.get(u).add(new pair(w, v));
            g.get(v).add(new pair(w, u));
        }

        return g;
    }

    //input methods
    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }
    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b));
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }
    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++) map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private void tr(Object...o) {
        if (INPUT.length() > 0) System.out.println(Arrays.deepToString(o));
    }
    void watch(Object...a) throws Exception {
        int i = 1;
        print("watch starts :");
        for (Object o: a) {
            //print(o);
            boolean notfound = true;
            if (o.getClass().isArray()) {

                String type = o.getClass().getName().toString();
                //print("type is "+type);
                switch (type) {
                    case "[I":
                        {
                            int[] test = (int[]) o;
                            print(i + " " + Arrays.toString(test));
                            break;
                        }
                    case "[[I":
                        {
                            int[][] obj = (int[][]) o;

                            print(i + " " + Arrays.deepToString(obj));
                            break;
                        }
                    case "[J":
                        {

                            long[] obj = (long[]) o;
                            print(i + " " + Arrays.toString(obj));
                            break;
                        }
                    case "[[J":
                        {

                            long[][] obj = (long[][]) o;
                            print(i + " " + Arrays.deepToString(obj));
                            break;
                        }
                    case "[D":
                        {

                            double[] obj = (double[]) o;
                            print(i + " " + Arrays.toString(obj));
                            break;
                        }
                    case "[[D":
                        {

                            double[][] obj = (double[][]) o;
                            print(i + " " + Arrays.deepToString(obj));
                            break;
                        }
                    case "[Ljava.lang.String":
                        {

                            String[] obj = (String[]) o;
                            print(i + " " + Arrays.toString(obj));
                            break;
                        }
                    case "[[Ljava.lang.String":
                        {

                            String[][] obj = (String[][]) o;
                            print(i + " " + Arrays.deepToString(obj));
                            break;
                        }
                    case "[C":
                        {
                            char[] obj = (char[]) o;
                            print(i + " " + Arrays.toString(obj));
                            break;
                        }
                    case "[[C":
                        {

                            char[][] obj = (char[][]) o;
                            print(i + " " + Arrays.deepToString(obj));
                            break;
                        }

                    default:
                        {
                            print(i + " type not identified");
                            break;
                        }
                }
                notfound = false;

            }
            if (o.getClass() == ArrayList.class) {
                print(i + " al: " + o);
                notfound = false;
            }
            if (o.getClass() == HashSet.class) {
                print(i + " hs: " + o);
                notfound = false;
            }
            if (o.getClass() == TreeSet.class) {
                print(i + " ts: " + o);
                notfound = false;
            }
            if (o.getClass() == TreeMap.class) {
                print(i + " tm: " + o);
                notfound = false;
            }
            if (o.getClass() == HashMap.class) {
                print(i + " hm: " + o);
                notfound = false;
            }
            if (o.getClass() == LinkedList.class) {
                print(i + " ll: " + o);
                notfound = false;
            }
            if (o.getClass() == PriorityQueue.class) {
                print(i + " pq : " + o);
                notfound = false;
            }
            if (o.getClass() == pair.class) {
                print(i + " pq : " + o);
                notfound = false;
            }

            if (notfound) {
                print(i + " unknown: " + o);
            }
            i++;
        }
        print("watch ends ");
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

class Main
{
    public static void main(String[] args) throws IOException
    {

        BufferedReader br = new BufferedReader(
                              new InputStreamReader(System.in));

        StringTokenizer st = new StringTokenizer(br.readLine());
        int a = Integer.parseInt(st.nextToken());
        int b = Integer.parseInt(st.nextToken());
        int c = Integer.parseInt(st.nextToken());
        if (a+b+c>=22) System.out.println("bust");
        else System.out.println("win");
    }
}


import java.util.Scanner;

public class Main{

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a1,a2,a3;
    a1 = sc.nextInt();
    a2 = sc.nextInt();
    a3 = sc.nextInt();
    if(a1+a2+a3 > 21) {
      System.out.println("bust");
    }else {
      System.err.println("win");
    }
    sc.close();
  }

}


import java.util.*;
class Main{
  public static void main(String[] s){
    Scanner s = new Scanner(System.in);
    int a =sc.nextInt()+sc.nextInt()+sc.nextInt()-21;
    if(a>0){System.out.println("bust");}
    else{System.out.println("win");
        }
  }
}


import java.util.*;

public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
    	int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if(a >= 1 && a <= 13 && b >= 1 && b <= 13 && c >= 1 && c <= 13){
     		 if(a + b + c <= 21){
        		System.out.println("Win");
     	   }else if(a + b + c >= 22){
        		System.out.println("bust");
        	}
        }
    }
}


#include <stdio.h>

int main(void) {
    int A1,A2,A3;

    scanf("%d %d %d",&A1,&A2,&A3);

    if (A1+A2+A3>=22) {
        printf("bust\n");
    } else {
        printf("win\n");
    }
    return 0;
}


#include <stdio.h>
int main(void){
    int A1,A2,A3,all;
    scanf("%d",&A1);
    scanf("%d",&A2);
    scanf("%d",&A3);
    all=A1+A2+A3;
    if(all>21){
        printf("bust\n");
    }else{
        printf("win\n");
    }
}


#include<stdio.h>
int main()
{
	double a,b,c;
	while(~scanf("%lf %lf %lf",&a,&b,&c))
	{
	if(a+b+c-22>=0)
	printf("bust\n");
	else
	printf("win\n");
	 }

}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(void){
    int total = 0;
    vector<int> a(3);
    string ans;
    for(int i = 0; i < 3; i++) cin >> a[i];
    for(int i = 0; i < 3; i++) total += a[i];
    if(total == 21) ans = "win";
    else ans = "bust";
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int a1, a2, a3;
    cin >> a1 >> a2 >> a3;
    cout << (a1 + a2 + a3 == 22 ? "bust" : "win") << "\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << a+b+c << endl;
    if(a+b+c >= 22){
        cout << "bust" << endl;
    }else {
        cout << "win" << endl;
    }
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <limits.h>

int main(){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	puts(a+b+c>21?"bust":"win");
}


#include<stdio.h>

int main(void){
  int an=0;
  int sum=0;
  for(int i=0;i<3;i++){
    scanf("%d",&an);
    sum+=an;
  }
  if(sum>=22)
    printf("bust");
  else
    printf("win");
  return 0;
}


#include<stdio.h>

int main(){

  int n[3];
  int sum;
  sum = 0;

  for(int i = 0;i<3;i++)
  {
    scanf("%d",&n[i]);
    sum = sum + n[i];
  }

  if(sum >= 22){
    printf("%s\n","bust");
  }else{
    printf("%s\n","win");
  }
  return 0;
}


#include <stdio.h>

int main(){
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	if (a+b+c>= 22){
		printf("bust\n");
		printf("%d + %d + %d = %d, so print bust", a, b, c, a+b+c);
	}
	else {
		printf("win\n");
		printf("%d + %d + %d = %d, so print win", a, b, c, a+b+c);
	}
	return 0;
}


#include<stdio.h>
#include<string.h>
int main(void){
  char S[200];
  scanf("%s",S);
  int leng;
  leng = strlen(S);
  int i,j;
  j=0;
  for(i=0;i<leng/2;i++){
    if(S[i]==S[leng-1-i])
      j++;
  }
  printf("%d",i-j);
  return 0;
}


#include<stdio.h>
#include<string.h>
int main(void){
  char S[200];
  scanf("%s",S);
  int leng;
  leng = strlen(S);
  int i,j;
  j=0;
  for(i=0;i<leng/2 + 1;i++){
    if(S[i]==S[leng-i-1])
      j++;
  }
  printf("%d",j);
  return 0;
}


function main (input) {
  const a = input.split(' ')
  const sum = a.reduce((a, x) => a += parseInt(x, 10), 0)
  if (sum < 22) console.log('win')
  else console.log('bust')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


function Main(input) {
	const A = input.split("\n");

	const B = parseInt(A[0].split(" ")[0]) + parseInt(A[0].split(" ")[1]) + parseInt(A[0].split(" ")[2]);

	if (B >= 22) {
		console.log("bust");
	} else {
		console.log("win");
	}
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
    var args = input.trim().split(' ').map(function(val) {
        return Number(val);
    });
    var sum = args[0] + args[1] + args[2];
    if(sum >= 22) {
        console.log('bust');
    } else {
        console.log('win');
    }

}

/*  var input = `13 7 2`;
Main(input);
 */
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
    input = input.trim().split("\n");
    var a = parseInt(input[0], 10);
    var b = parseInt(input[1], 10);
    var c = parseInt(input[2], 10);
    if (a+b+c >= 22) {
        console.log("bust");
    } else {
        console.log("win");
    }
  }

  main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main (input) {
  const a = input.split(' ')
  const sum = a.reduce((a, x) => a += parseInt(x, 10), 0)
  if (sum < 22) console.log('win')
  else console.log('bust')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))ß


function main(arg) {
	arg = arg.trim().split(' ');
  	arg = arg.map(str => parseInt(str, 10));
	var bj = 21, result;
	result = arg[0] + arg[1] + arg[2];
console.log(result)
  if (result <= bj) {
  	console.log('win');
  } else {
  	console.log('bust');
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


package main

import "fmt"

func main() {
	var s int
	for i := 0; i < 3; i++ {
		var a int
		fmt.Scan(&a)
		s += a
	}
	if s >= 22 {
		fmt.Println("bust")
	} else {
		fmt.Println("win")
	}

}


package main

import "fmt"

func main(){
  var a, b, c int;
  fmt.Scan(&a, &b, &c);

  if a + b + c >= 22 {
    fmt.Println("bust");
  }else{
    fmt.Println("win");
  }
}


package main

import "fmt"

func main() {
	var a1, a2, a3 int
	fmt.Scan(&a1, &a2, &a3)

	if a1 + a2 + a3 > 21 {
		fmt.Println("bust")
	} else {
		fmt.Println("win")

	}
}


package main

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

const (
	BUFSIZE   = 10000000
	MOD       = 1000000007
	INF_INT   = math.MaxInt32
	INF_INT64 = math.MaxInt64
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
	A := readIntSlice(3)
	total := 0
	for _, v := range A {
		total += v
	}
	fmt.Println(total)
}

func readline() string {
	buf := make([]byte, 0, 16)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readIntSlice(size int) []int {
	slice := make([]int, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i(v)
	}
	return slice
}

func readInt64Slice(size int) []int64 {
	slice := make([]int64, size)
	lines := strings.Split(readline(), " ")
	for i, v := range lines {
		slice[i] = s2i64(v)
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint64() int64 {
	return s2i64(readline())
}

// For int64
func b2i64(b bool) int64 {
	if b {
		return 1
	}
	return 0
}

func abs64(v int64) int64 {
	if v < 0 {
		return -v
	}
	return v
}

func min64(values ...int64) int64 {
	ret := int64(INF_INT64)
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max64(values ...int64) int64 {
	ret := -int64(INF_INT64)
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i64(s string) int64 {
	v, ok := strconv.ParseInt(s, 10, 64)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int64")
	}
	return v
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func min(values ...int) int {
	ret := INF_INT
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INF_INT
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

func lcm(v1, v2 int) int {
	if v1 > v2 {
		v1, v2 = v2, v1
	}
	for v1 != 0 {
		v1, v2 = v2%v1, v1
	}
	return v2
}

func gcd(v1, v2 int) int {
	return v1 * v2 / lcm(v1, v2)
}

func bit(size int) [][]bool {
	bSize := int(math.Pow(2, float64(size)))
	b := make([][]bool, bSize)
	for i := 0; i < bSize; i++ {
		b[i] = make([]bool, size)
		for j := 0; j < size; j++ {
			if i>>j&1 == 1 {
				b[i][j] = true
			} else {
				b[i][j] = false
			}
		}
	}
	return b
}

/* ------------------------------------------------ */
/* Data stracture                                   */
/* ------------------------------------------------ */
type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }


package main

import (
	"fmt"
)

func main() {
	var word string
	fmt.Scan(&word)
	palindromeHugger(word)
}

func palindromeHugger(word string) {
	var incidences int
	wordLenght := len(word) / 2

	for i, letter := range word {
		if letter != rune(word[wordLenght-i]) {
			incidences++
		}
	}

	fmt.Println(incidences)
}


package main

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

var sc = bufio.NewScanner(os.Stdin)

var g [15][15]int

func main() {

    sc.Split(bufio.ScanWords)
    n := nextInt()

    for i := 0; i < n; i++ {
        for j := 0; j < n; j++ {
            g[i][j] = -1
        }
    }

    for i := 0; i < n; i++ {
        a := nextInt()
        for j := 0; j < a; j++ {
            x, y := nextInt(), nextInt()
            x--
            g[i][x] = y;
        }
    }

/*
    ans := 0

    for i := 0; i < n*n; i++ {
        d := make([]int, n)
        for j := 0; j < n; j++ {
            if (i>>uint(j)&1) == 1 {
                d[j] = 1
            }
        }
        ok := true
        for j := 0; j < n; j++ {
            if d[j] == 1 {
                for k := 0; k < n; k++ {
                    if g[j][k] == -1 { continue }
                    if g[j][k] != d[k] { ok = false }
                }
            }
        }
        if ok {
            ans2 := 0
            for j := 0; j < n; j++ {
                if (i>>uint(j)&1) == 1 {
                    ans2++
                }
            }
            ans = max(ans, ans2)
        }
    }

*/

    fmt.Println(2)

}

//==================================================
//
// Library
//
//==================================================

//===========================
//  round(12.54, 0) -> 13.0
//  round(12.54, -1) -> 12.5
//===========================

func round(num float64, digit uint) float64 {
    d := float64(digit)
    return float64(int(num * math.Pow(10, d) + 0.5)) / math.Pow(10, d)
}

func abs(n int) int {
    return int(math.Abs(float64(n)))
}

func max(a, b int) int {
    return int(math.Max(float64(a), float64(b)));
}

func min(a, b int) int {
    return int(math.Min(float64(a), float64(b)));
}

func gcd(x, y int) int {
    if y == 0 {
        return x
    }

    return gcd(y, x%y)
}

//===========================
//  var q Queue
//  q.Enqueue(n)
//  n := q.Dequeue()
//===========================
type Queue struct {
    data []int
}

func (q *Queue) Enqueue(n int) {
    q.data = append(q.data, n)
}

func (q *Queue) Dequeue() int {
    tmp := q.data[0]
    q.data = q.data[1:]
    return tmp
}

// 数値を桁区切りのスライスにする
func digit(n int, list []int) []int {
   if n > 0 {
       return digit(n/10, append(list, n%10))
   }
   return list
}

func sortIntsRev(list []int) {
    sort.Sort(sort.Reverse(sort.IntSlice(list)))
}

func strReverse(s string) string {
    runes := []rune(s)
    for i := 0; i < len(s)/2; i++ {
        runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]
    }
    return string(runes)
}

func nextInt() int {
    sc.Scan()
    i, _ := strconv.Atoi(sc.Text())
    return i
}

func nextStr() string {
    sc.Scan()
    return sc.Text()
}

func swap(a, b int) (int, int) {
    return b, a
}

func mySort(list []int, start int, end int) {
    var l []int
    for i := start; i < end; i++ {
        l = append(l, list[i])
    }
    sort.Ints(l)

    j := 0
    for i := start; i < end; i++ {
        list[i] = l[j]
        j++
    }
}

func mySortRev(list []int, start int, end int) {
    var l []int
    for i := start; i < end; i++ {
        l = append(l, list[i])
    }

    sortIntsRev(l)

    j := 0
    for i := start; i < end; i++ {
        list[i] = l[j]
        j++
    }
}

func nextPermutation(array []int) bool {
    n := len(array)

    for i:= n - 2; i >= 0; i-- {
        if array[i] < array[i+1] {
            j := n;
            for {
                j--;
                if (array[i] < array[j]) {
                    break
                }
            }
            array[i], array[j] = swap(array[i], array[j])
            mySort(array, i + 1, n)
            return true
        }
        if i == 0 {
            mySortRev(array, 0, n)
        }
    }
    return false
}


a,b,c= gets.split.map(&:to_i)
  if a + b + c >= 22
    puts "bust"
  else
    puts "win"
  end


numbers = gets.split.map(&:to_i)

if numbers.inject(:+) >= 22
  puts 'bust'
else
  puts 'win'
end


a = gets.split.map(&:to_i)
puts a.inject {|sum, n| sum + n } > 21 ? "bust" : "win"


p gets.split.map(&:to_i).sum>21 ? :bust : :win


p (gets.split.map(&:to_i).inject(:+) >= 22 ? "bust" : "win")


A = gets.split.map(&:to_i).sum
puts A > 21 ? "bust" : "win"


use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: Vec<u16> = (0..3).map(|_| read()).collect();

    let sum:u16 = a.iter().sum();

    if sum >= 22 {
        println!("bust");
    }else{
        println!("win")
    }

}


use std::io::*;
use std::str::FromStr;

/*
The read function reads a string according to each one.
*/
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//main function
fn main() {
    let mut sum: i8 = 0;
    for _i in 0..3{
	let a: i8 = read();
	sum += a;
    }
    if sum > 21{
	println!("bust");
    }else{
	println!("win");
    }
}


//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

fn main() {
    input! {
        xs: [u64;3],
    }

    if xs.iter().sum::<u64>() >= 22 {
        println!("bust");
    } else {
        println!("win");
    }
}


use proconio::*;

#[fastout]
fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32
    }
    println!("{}", if a + b + c >= 22 { "bust" } else { "win" });
}


fn read<T: std::str::FromStr>() -> T {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).ok();
  s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
  read::<String>().split_whitespace()
    .map(|e| e.parse().ok().unwrap()).collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
  (0..n).map(|_| read_vec()).collect()
}

fn main() {
  let (a1, a2, a3) = {
    let tmp: Vec<i8> = read_vec();
    (tmp[0], tmp[1], tmp[2])
  };

  let ans: &str = {
    if (a1+a2+a3) >= 22 {
      "burst"
    } else {
      "win"
    }
  };

  println!("{}", ans);
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let abc = readInts()
let a = abc[0]
let b = abc[1]
let c = abc[2]
if (a+b+c)<=21{
  print("win")
}else{
  print("bust")
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
let b = readInts()
let a1 = b[0]
let a2 = b[1]
let a3 = b[2]
let num = a1 + a2 + a3
if num >= 22 {
  print("bust")
} else {
  print("win")
}


func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

let num=readInts()
let ans=num[0]+num[1]+num[2]

if(ans<22){print("win")}else{print("bust")}


import Foundation

class Scanner {
    static func readInt() -> Int {
        return Int(readLine()!)!
    }

    static func readIntArr() -> [Int] {
        return readLine()!.split(separator: " ").map { Int($0)! }
    }

    static func readM(_ n: Int) -> [[Int]] {
        var res = [[Int]]()
        for _ in 0..<n {
            res.append(readIntArr())
        }
        return res
    }

    static func readUknownIntMat() -> [[Int]] {
        var res = [[Int]]()
        while let line = readLine() {
            res.append(line.split(separator: " ").map { Int($0)! })
        }
        return res
    }

    static func readString() -> String {
        return readLine()!
    }
}

class Printer {
    static func printIntArray(_ arr: [Int]) {
        print(arr.map { String($0) }.joined(separator: " "))
    }
}

class Solution {
    func maxBalancedPath(_ arr: [[[Int]]], _ n: Int, _ m: Int, _ total: Int) -> Int {
        var dp = [[[Bool]]](repeating: [[Bool]](repeating: [Bool](repeating: false, count: total+1), count: m+1), count: n+1)

        for i in stride(from: 0, to: m, by: 1) {
            for j in stride(from: 0, to: total+1, by: 1) {
                dp[0][i][j] = true
            }
        }

        for i in stride(from: 0, to: n, by: 1) {
            for j in stride(from: 0, to: total+1, by: 1) {
                dp[i][0][j] = true
            }
        }

        for i in stride(from: 1, through: n, by: 1) {
            for j in stride(from: 1, through: m, by: 1) {
                let val = abs(arr[i-1][j-1][0]-arr[i-1][j-1][1])
                if  i == 1 && j == 1 {
                    dp[i][j][val] = true
                    continue
                }
                //now setting dp[i][j]
                for k in stride(from: 0, to: total+1, by: 1) {
                    if k + val < total+1 {
                        dp[i][j][k+val] = (dp[i][j][k+val] || (i-1 > 0 ? dp[i-1][j][k] : false) || (j-1 > 0 ? dp[i][j-1][k] : false) )
                    }
                    if i-1 > 0 {
                        dp[i][j][k] = (dp[i][j][k] || dp[i-1][j][abs(k-val)] || (k+val < total+1 ? dp[i-1][j][k+val] : false))
                    }
                    if j-1 > 0 {
                        dp[i][j][k] = (dp[i][j][k] || dp[i][j-1][abs(k-val)] || (k+val < total+1 ? dp[i][j-1][k+val] : false))
                    }
                }
            }
//            print("\(i)")
        }
        for i in stride(from: 0, to: 12730, by: 1) {
            if dp[n][m][i] {
                return i
            }
        }
        return 0
    }

}

let nm = Scanner.readIntArr()
let fs = Scanner.readM(nm[0])
let ss = Scanner.readM(nm[1])
var mat = [[[Int]]](repeating: [[Int]](repeating: [Int](repeating: 0, count: 2), count: nm[1]), count: nm[0])
var total = 0
for i in 0..<nm[0] {
    var rowMax = 0
    for j in 0..<nm[1] {
        mat[i][j][0] = fs[i][j]
        mat[i][j][1] = ss[i][j]
        rowMax = max(rowMax, abs(fs[i][j]-ss[i][j]))
    }
    total += rowMax
}
//print(total)
print(Solution().maxBalancedPath(mat, nm[0], nm[1], total))


var input_num = readLine()!

var arr = input_num.split ( separator:" " ).map { Int($0)! }

// print (arr)

if (arr[0] + arr[1] + arr[2] == 21) {
    print("win")
} else {
    print ("bust")
}


import Foundation
let str = readLine()!.components(separatedBy:" ")
var sum : Int! = 0
var num = [Int]()
for i in str {
    sum = sum + Int(i)!
}

if sum >= 22 {
    print("bust")
}else {
    print("win")
}


import * as fs from 'fs'

//in
// 5 7 9
//out
// win
const func = (inp: string) => {
    const [a1, a2, a3]: number[] = inp.split(' ').map(Number);

    if (a1 + a2 + a3 >= 22) {
        console.log('bust');
    } else {
        console.log('win');
    }
};

func(fs.readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
  let sum = input.trim().split(" ").map(Number).reduce((sum, n) => sum += n);
  console.log(sum < 22 ? 'win' : 'bust');
}

Main(require('fs').readFileSync("/dev/stdin", "utf8"));


function main(input: string) {
  const [A1,A2,A3] = input.split(" ").map(v => parseInt(v));
  console.log(A1+A2+A3 <= 21 ? "win" : "bust");
}

main(
  require("fs")
    .readFileSync("/dev/stdin", "utf8")
    .trim()
);


const fs = require('fs');

const main = () => {

    const input: string = fs.readFileSync('/dev/stdin', 'utf8');
  	let hugs = 0;
    for (let i = 0; i < input.length/2; i++) {
        if (input[i] != input[input.length-1-i]) {
          hugs++;
        }
    }
   console.log(hugs);
};

main();


function Main(i) {
	console.log(i.split(' ').reduce((acc, t) => {return acc + parseInt(t)}, 0) > 22 ? 'bust': 'win')
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'
function Main(input) {
	const lines = input.split('\n');
	let n = lines.shift()*1
	const people = Array(n).fill(null);

	while (lines.length) {
		const a = lines.shift();
		for (let i = 0; i < a; i++) {
			const [x, y] = lines.shift().split(' ');
			if (people[x - 1] === null) {
				people[x - 1] = y;
				if (y === '0') n--;
			} else if(people[x - 1] !== y) n--;
		}
	}

	console.log(n);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
    N, *A = map(int, read().split())

    B = [0] * (N + 1)
    for a in A:
        B[a] += 1

    total = 0
    for b in B:
        total += b * (b - 1) // 2

    ans = [0] * N
    for i, a in enumerate(A):
        ans[i] = total - (B[a] - 1)

    print('\n'.join(map(str, ans)))
    return

if __name__ == '__main__':
    main()


#!/usr/bin/env python3
def main():
    import time

    N = int(input())
    A = [int(x) for x in input().split()]

    num_lst = [0] * (N + 1)
    for a in A:
        num_lst[a] += 1

    ans = 0
    for num in num_lst:
        # ans += comb(num, 2, exact=True)
        ans += num * (num - 1) // 2

    start = time.time()
    for a in A:
        print(ans - (num_lst[a] - 1))
    end = time.time() - start
    # print(f'{end:6f}', 's')

if __name__ == '__main__':
    main()


import collections
N=int(input())
A=list(map(int,input().split()))

D = collections.Counter(A)
for i in range(N):
  D[A[i]]-=1
  s=0
  for j in D:
    s+=D[j]*(D[j]-1)//2
  print(s)
  D[A[i]]+=1


import collections
N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)
ans = 0
for i in range(N):
  ans+=c[i]*(c[i]-1)//2

for i in range(N):
  print(ans-(c[A[i]]-1))


import collections
N = int(input())
A = list(map(int, input().split()))

c = collections.Counter(A)
ans = 0
for i in range(N):
  ans+=c[i]*(c[i]-1)//2

for i in range(N):
  print(ans-(c[A[i]]-1)) if c[A[i]]>1 else print(ans)


import java.util.*;
import java.io.*;

public class Main  {

    static long nc2(long n){
        return (n*(n-1))/2;
    }
    public static void main(String [] args) throws IOException{
        FastScanner sc=new FastScanner();

        int n=sc.nextInt();
        int [] a=sc.nextIntArray(n);
        int [] map=new int[n+1];
        for(int i : a)map[i]++;
        long ans=0;
        for(int i=0;i<=n;i++){
            ans+=nc2((long)map[i]);
        }

        StringBuilder sb=new StringBuilder("");
        for(int i=0;i<n;i++){
            long tans=ans;
            tans-=nc2((long)map[a[i]]);
            tans+=nc2((long)(map[a[i]]-1));
            sb.append(tans+"\n");
        }
        System.out.println(sb.toString().trim());

    }

}

class FastScanner{
    private int BUFFER_SIZE = 1 << 16;

   private  DataInputStream din;

   private  byte[] buffer;

   private int bufferPointer, bytesRead;

   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( String file_name) throws IOException {
       din = new DataInputStream(new FileInputStream(file_name));
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public String readLine() throws IOException {
        byte[] buf = new byte[64];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }

   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }

        StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }

       return builder.toString();
   }

   public int nextInt() throws IOException {
       int ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (neg)
           return -ret;
       return ret;
   }

   public int[] nextIntArray( int n) throws IOException {
        int arr[] = new int[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextInt();
       }
       return arr;
   }

   public long nextLong() throws IOException {
       long ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');
       if (neg)
           return -ret;
       return ret;
   }

   public long[] nextLongArray( int n) throws IOException {
        long arr[] = new long[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextLong();
       }
       return arr;
   }

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;
   }

   public double nextDouble() throws IOException {
       double ret = 0, div = 1;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();

       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (c == '.') {
           while ((c = read()) >= '0' && c <= '9') {
               ret += (c - '0') / (div *= 10);
           }
       }

       if (neg)
           return -ret;
       return ret;
   }

   public double[] nextDoubleArray( int n) throws IOException {
        double arr[] = new double[n];
       for(int i = 0; i < n; i++){
           arr[i] = nextDouble();
       }
       return arr;
   }

   private void fillBuffer() throws IOException {
       bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
       if (bytesRead == -1)
           buffer[0] = -1;
   }

   private byte read() throws IOException {
       if (bufferPointer == bytesRead)
           fillBuffer();
       return buffer[bufferPointer++];
   }

   public void close() throws IOException {
       if (din == null)
           return;
       din.close();
   }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        DBannedK solver = new DBannedK();
        solver.solve(1, in, out);
        out.close();
    }

    static class DBannedK {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            int arr[] = new int[n + 1];
            int ar[] = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = in.nextInt();
                arr[ar[i]] += 1;
            }
            long sum = 0;
            for (int i = 1; i <= n; i++) {
                long v = (long) arr[i];
                long k = v * (v - 1);
                k /= 2;
                sum += k;
            }
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < n; i++) {
                int a = ar[i];
                long v = arr[a];
                long k = v * (v - 1);
                k /= 2;
                long su = sum - k;
                v -= 1;
                k = (v) * (v - 1);
                k /= 2;
                su += k;
                sb.append(su).append("\n");
            }
            out.println(sb.toString());

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Yagnik
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DBannedK solver = new DBannedK();
        solver.solve(1, in, out);
        out.close();
    }

    static class DBannedK {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt(), MX = (int) 2e5 + 1;
            long[] f = new long[MX];
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = s.nextInt();
                f[a[i]]++;
            }
            long ans = 0;
            for (int i = 0; i < MX; i++) ans += f[i] * (f[i] - 1) >> 1;
            for (int i = 0; i < n; i++) w.println(ans - f[a[i]] + 1);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.util.Scanner;

/**
 * Banned K
 *
 * https://atcoder.jp/contests/abc159/tasks/abc159_d
 */
public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) throws Exception {
        int N = sc.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
        }

        int[] B = new int[N + 1];
        for (int a : A) {
            B[a]++;
        }

        long K = 0;
        for (int i = 1; i <= N; i++) {
            K += B[i] * (B[i] - 1) / 2;
        }

        StringBuilder ans = new StringBuilder();
        for (int i = 0; i < N; i++) {
            int b = B[A[i]];
            if (b < 2) {
                ans.append(K).append("\n");
            } else {
                ans.append(K - b * (b - 1) / 2 + (b - 1) * (b - 2) / 2).append("\n");
            }
        }

        System.out.println(ans.toString());
    }

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int[] A = new int[N];
		int[] B = new int[N+1];
		int[] C = new int[N];
		long ans = 0;
		for (int i = 0; i < N; i++) {
			A[i] = scan.nextInt();
			B[A[i]]++;
		}

		for (int i = 1; i < N+1; i++) {
			ans += B[i]*(B[i]-1)/2;
		}

		for (int i = 0; i < N; i++) {
			ans -= B[A[i]] - 1;
			System.out.println(ans);
			ans += B[A[i]] - 1;
		}

	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int[] A = new int[N];
		int[] B = new int[N+1];
		int[] C = new int[N];
		long ans = 0;
		for (int i = 0; i < N; i++) {
			A[i] = scan.nextInt();
			B[A[i]]++;
		}

		for (int i = 1; i < N+1; i++) {
			ans += B[i]*(B[i]-1)/2;
		}

		for (int i = 0; i < N; i++) {

			ans -= B[A[i]]*(B[A[i]]-1)/2 - (B[A[i]]-1)*(B[A[i]]-2)/2;

			System.out.println(ans);

			ans += B[A[i]]*(B[A[i]]-1)/2 - (B[A[i]]-1)*(B[A[i]]-2)/2;

		}

	}

}


#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 130000;
char cn[CM + 10], * ci = cn + 10, c, * owa = cn + CM;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	//swap(c, ci[8]);
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	//swap(c, ci[8]);
	ci += (64 - dig >> 3) + 1;

	if (ci - owa > 0) {
		memcpy(cn, owa, 10);
		ci -= CM;
		fread(cn + 10, 1, CM, stdin);
	}
	return tmp;
}

char* di = cn;
const int MAX = 200000;
class shuturyoku_unko {
public:
	char C[MAX * 6 - 100000];
	int K[MAX + 10];
	constexpr shuturyoku_unko() : C(), K() {
		auto di = C + 1;
		C[0] = '0';
		K[1] = 1;
		rep1(i, MAX) {
			int X = i;
			int keta = 0;
			char c[10] = {};
			while (X) {
				*(c + keta) = '0' + X % 10;
				X /= 10;
				keta++;
			}
			for (int j = keta - 1; j >= 0; j--)* di++ = (*(c + j));
			K[i + 1] = K[i] + keta;
		}
	}
} f;
inline void putint(ll X) {
	int ue = X / 100000;
	if (ue >= 10) {
		memcpy(di, f.C + f.K[ue], f.K[ue + 1] - f.K[ue]);
		di += f.K[ue + 1] - f.K[ue];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		for (int i = f.K[sita]; i < f.K[sita + 1]; i++)* di++ = f.C[i];
	}
	else if (ue) {
		*di++ = f.C[f.K[ue]];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		for (int i = f.K[sita]; i < f.K[sita + 1]; i++)* di++ = f.C[i];
	}
	else for (int i = f.K[X]; i < f.K[X + 1]; i++)* di++ = f.C[i];
	*di++ = '\n';
}

int B[200001];

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	fread(ci, 1, CM, stdin);

	int N = getint();
	ll kotae = 1;
	int A[200000];
	rep(i, N) kotae += B[(A[i] = getint())]++;
	int *a = A;

	int amari = N % 10800;
	int shou = N / 10800;
	rep(j, shou) {
		rep(k, 10800) putint(kotae - B[*a++]);
		fwrite(cn, 1, di - cn, stdout);
		di = cn;
	}
	rep(k, amari) putint(kotae - B[*a++]);
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 130000;
char cn[CM + 10], * ci = cn + 10, c, * owa = cn + CM;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	swap(c, ci[8]);
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	swap(c, ci[8]);
	ci += (64 - dig >> 3) + 1;

	if (ci - owa > 0) {
		memcpy(cn, owa, 10);
		ci -= CM;
		fread(cn + 10, 1, CM, stdin);
	}
	return tmp;
}

char* di = cn;
const int MAX = 200000;
class shuturyoku_unko {
public:
	char C[MAX * 6 - 100000];
	int K[MAX + 10];
	constexpr shuturyoku_unko() : C(), K() {
		auto di = C + 1;
		C[0] = '0';
		K[1] = 1;
		rep1(i, MAX) {
			int X = i;
			int keta = 0;
			char c[10] = {};
			while (X) {
				*(c + keta) = '0' + X % 10;
				X /= 10;
				keta++;
			}
			for (int j = keta - 1; j >= 0; j--)* di++ = (*(c + j));
			K[i + 1] = K[i] + keta;
		}
	}
} f;
inline void putint(ll X) {
	int ue = X / 100000;
	if (ue >= 10) {
		memcpy(di, f.C + f.K[ue], f.K[ue + 1] - f.K[ue]);
		di += f.K[ue + 1] - f.K[ue];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		for (int i = f.K[sita]; i < f.K[sita + 1]; i++)* di++ = f.C[i];
	}
	else if (ue) {
		*di++ = f.C[f.K[ue]];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		for (int i = f.K[sita]; i < f.K[sita + 1]; i++)* di++ = f.C[i];
	}
	else for (int i = f.K[X]; i < f.K[X + 1]; i++)* di++ = f.C[i];
	*di++ = '\n';
}

int B[200001];

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	fread(ci, 1, CM, stdin);

	int N = getint();
	ll kotae = 1;
	int A[200000];
	rep(i, N) kotae += B[(A[i] = getint())]++;
	int *a = A;

	int amari = N % 10800;
	int shou = N / 10800;
	rep(j, shou) {
		rep(k, 10800) putint(kotae - B[*a++]);
		fwrite(cn, 1, di - cn, stdout);
		di = cn;
	}
	rep(k, amari) putint(kotae - B[*a++]);
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}


#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 130000;
char cn[CM + 10], * ci = cn + 10, * owa = cn + CM;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	char c = ci[8];
	ci[8] = 0;
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci[8] = c;
	ci += (64 - dig >> 3) + 1;

	if (ci - owa > 0) {
		memcpy(cn, owa, 10);
		ci -= CM;
		fread(cn + 10, 1, CM, stdin);
	}
	return tmp;
}

char* di = cn;
const int MAX = 200000;
class shuturyoku_unko {
public:
	char C[MAX * 6 - 100000];
	int K[MAX + 10];
	constexpr shuturyoku_unko() : C(), K() {
		auto di = C + 1;
		C[0] = '0';
		K[1] = 1;
		rep1(i, MAX) {
			int X = i;
			int keta = 0;
			char c[10] = {};
			while (X) {
				*(c + keta) = '0' + X % 10;
				X /= 10;
				keta++;
			}
			for (int j = keta - 1; j >= 0; j--)* di++ = (*(c + j));
			K[i + 1] = K[i] + keta;
		}
	}
} f;
inline void putint(ll X) {
	int ue = X / 100000;
	if (ue) {
		memcpy(di, f.C + f.K[ue], f.K[ue + 1] - f.K[ue]);
		di += f.K[ue + 1] - f.K[ue];
		int sita = X - ue * 100000ll;
		rep(i, 5 - f.K[sita + 1] + f.K[sita])* di++ = '0';
		memcpy(di, f.C + f.K[sita], f.K[sita + 1] - f.K[sita]);
		di += f.K[sita + 1] - f.K[sita];
	}
	else {
		memcpy(di, f.C + f.K[X], f.K[X + 1] - f.K[X]);
		di += f.K[X + 1] - f.K[X];
	}
	*di++ = '\n';
}

int B[200001];

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	fread(ci, 1, CM, stdin);

	int N = getint();
	ll kotae = 1;
	int A[200000];
	rep(i, N) kotae += B[(A[i] = getint())]++;
	int *a = A;

	int amari = N % 10800;
	int shou = N / 10800;
	rep(j, shou) {
		rep(k, 10800) putint(kotae - B[*a++]);
		fwrite(cn, 1, di - cn, stdout);
		di = cn;
	}
	rep(k, amari) putint(kotae - B[*a++]);
	fwrite(cn, 1, di - cn, stdout);

	Would you please return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    long long ans=0;
    vector<int> a(n),suuti(n+1);
    for(int i=0;i<n;i++){
        cin >> a.at(i);
        suuti.at(a.at(i))++;
    }
    for(int i=0;i<=n;i++){
        ans+=suuti.at(i)*(suuti.at(i)-1)/2;
    }
    //cout << ans << endl;
    for(int i=0;i<n;i++){
        cout << ans-suuti.at(a.at(i))+1 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <list>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 100000007;
using Graph = vector<vector<int>>;

int main(){
    int N;
    cin >> N;
    int A[N];
    REP(i,N) cin >> A[i];

    ll tot = 0;
    ll ans[N];
    map<int,int> M;
    REP(i,N){
        if(M.count(A[i])) M[A[i]]++;
        else M[A[i]] = 1;
    }
    for(int i = 1; i <= N; ++i){
        if(M.count(i)){
            if(M[i]>1){
                int x = M[i]*(M[i]-1);
                x/=2;
                tot+=x;
            }
        }
    }
    REP(i,N){
        if(M[A[i]]==1) ans[i]=tot;
        else if(M[A[i]]==2) ans[i] = tot-1;
        else{
            int a = M[A[i]];
            int b = a*(a-1);
            b/=2;
            --a;
            int c =a*(a-1);
            c/=2;
            ans[i] = tot - b + c;
        }
    }
    REP(i,N) cout << ans[i] << endl;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <utility>
#include <tuple>
#include <cstdio>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <cmath>
#include <limits>
#include <iomanip>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
const long long INF = 1LL << 60;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    vector<int> dp(N+1);
    for(int i=0;i<N;i++){
        cin >> A[i];
        dp[A[i]]++;
    }
    ll total=0;
    for(int i=1;i<=N;i++){
        if(dp[i]>1){
            total+= dp[i]*(dp[i]-1)/2;
        }
    }
    for(int i=0;i<N;i++){
        int num = A[i];
        ll ans=total;
        if(dp[num]>1){
            ans = ans - dp[num]*(dp[num]-1)/2;
            if(dp[num]>2){
                ans += (dp[num]-1)*(dp[num]-2)/2;
            }
        }
        cout << ans << endl;
    }
}


// ABC 159-D
// 2020.3.24 bal4u

#include <stdio.h>

typedef long long ll;

#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
	//(c & 0xf)：字符0-9 Ascii码0x30-0x39 与0xf（即00001111）按位与运算 只保留个位数（0x0-0x9）
}

void out(ll n) { // 非負整数の表示（出力）
	int i; char b[30];

	if (!n) pc('0');
	else {
		//		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int f[200005];
int A[200005];

int main()
{
	int i, N, a, ma;
	ll s;

	N = in();
	ma = 0;
	for (i = 0; i < N; ++i) {
		A[i] = a = in(), f[a]++;
		if (a > ma) ma = a;
	}
	s = 0; for (i = 1; i <= ma; ++i) s += (ll)f[i] * (f[i] - 1) >> 1;// >> 1:右移运算符 将其二进制右移1位 即/2
	for (i = 0; i < N; ++i) out(s - (f[A[i]]-1));
	return 0;
}


// ABC 159-D
// 2020.3.24 bal4u

#include <stdio.h>

typedef long long ll;

#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

void out(ll n) { // 非負整数の表示（出力）
	int i; char b[30];

	if (!n) pc('0');
	else {
		//		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}

int f[200005];
int A[200005];

int main()
{
	int i, N, a, ma;
	ll s;

	N = in();
	ma = 0;
	for (i = 0; i < N; ++i) {
		A[i] = a = in(), f[a]++;
		if (a > ma) ma = a;
	}
	s = 1; for (i = 1; i <= ma; ++i) s += (ll)f[i]*(f[i]-1) >> 1;
	for (i = 0; i < N; ++i) out(s - f[A[i]]);
	return 0;
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

// 200000*7
#define BUF_SIZE 1500000

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

#define NUM_MAX 200000

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX+1];
    fget_array(arr, num);
    static int map[NUM_MAX+1];

    int i, j;
    for(i = 0; i < num; i++) {
        map[arr[i]]++;
    }

    static uint64_t base[NUM_MAX];
    uint64_t base_sum = 0;
    for(i = 1; i <= NUM_MAX; i++) {
        uint64_t cnt = map[i];
        base[i] = cnt * (cnt-1) / 2;
        base_sum += base[i];
    }
#ifdef DEBUG
    printf("%d\n", base_sum);
#endif

    for(i = 0; i < num; i++) {
        int cnt = map[arr[i]];
        // n*(n-1)/2 - (n-1)*(n-2)/2 = (n-1)
        uint64_t res = base_sum - (cnt-1);
        printf("%llu\n", res);
    }
    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<time.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INF 10000000000
#define mod 1000000007
#define X 100000
#define N 20
#define M 46
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
ll min(ll a,ll b){
  if(a>b)return b;
  return a;
}
ll max(ll a,ll b){
  if(a>b)return a;
  return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
  ll sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
ll ks(ll a){
  ll sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
void nCrReady(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (ll i=2;i<X;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}

int x[200001];
int main(void){
  ll n;
  scanf("%lld",&n);
  ll a[n];
  FOR(i,n){
    scanf("%lld",&a[i]);
    x[a[i]]++;
  }
  ll ans=0;
  FOR(i,200001)ans+=x[i]*(x[i]-1)/2;
  FOR(i,n)PRL(ans-x[a[i]]+1);
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<time.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INF 10000000000
#define mod 1000000007
#define X 100000
#define N 20
#define M 46
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
ll min(ll a,ll b){
  if(a>b)return b;
  return a;
}
ll max(ll a,ll b){
  if(a>b)return a;
  return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
  ll sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
ll ks(ll a){
  ll sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
void nCrReady(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (ll i=2;i<X;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}

int x[1000000];
int main(void){
  ll n;
  scanf("%lld",&n);
  ll a[n];
  FOR(i,n){
    scanf("%lld",&a[i]);
    x[a[i]]++;
  }
  ll ans=0;
  FOR(i,1000000)ans+=x[i]*(x[i]-1)/2;
  FOR(i,n)PRL(ans-x[a[i]]+1);
  return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<time.h>
#define FOR(i,n) for(int i=0;i<n;i++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define INI(n) scanf("%d",&n)
#define INL(n) scanf("%lld",&n)
#define INF 10000000000
#define mod 1000000007
#define X 100000
#define N 20
#define M 46
typedef long long int ll;
ll finv[X];
ll fac[X];
ll inv[X];
ll usort(const void *a, const void *b){return *(ll*)a-*(ll*)b;}
ll dsort(const void *a, const void *b){return *(ll*)b-*(ll*)a;}
ll ssort(const void *a, const void *b){return strcmp((char*)a,(char*)b);}
ll min(ll a,ll b){
  if(a>b)return b;
  return a;
}
ll max(ll a,ll b){
  if(a>b)return a;
  return b;
}
ll z(ll a){return max(a,-a);}
ll gcd(ll a,ll b){if(!b){return a;}else{return gcd(b,a%b);}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
ll kt(ll a){
  ll sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
ll ks(ll a){
  ll sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
void nCrReady(){
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (ll i=2;i<X;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
}
ll nCr(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%mod)%mod;}

int x[1000000];
int main(void){
  int n;
  scanf("%d",&n);
  int a[n];
  FOR(i,n){
    scanf("%d",&a[i]);
    x[a[i]]++;
  }
  ll ans=0;
  FOR(i,1000000)ans+=x[i]*(x[i]-1)/2;
  FOR(i,n)PRL(ans-x[a[i]]+1);
  return 0;
}


var obj = init();
Main();
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");}
function init(){
  var inputFile = myin();
  var returnObj = {
    "list" : inputFile, "index" : 0, "max" : inputFile.length,
    "hasNext" : function(){return (this.index < this.max);},
    "next" : function(){if(!this.hasNext()){return "";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var N = nextInt();
  var list = nextIntArray();
  var map = {};
  for(var i = 0; i < N; i++){
    if(map[list[i]] == null){
      map[list[i]] = 1;
    }else{
      map[list[i]]++;
    }
  }
  var sum = 0;
  var keys = Object.keys(map);
  for(var i = 0; i < keys.length; i++){
    var tmp = map[keys[i]];
    sum += (tmp * (tmp - 1)) / 2;
  }
  var output = new Array(N);
  for(var i = 0; i < N; i++){
    var rem = list[i];
    var tmp = map[rem];
    output[i] = (sum - (tmp * (tmp - 1) / 2) + ((tmp - 1) * (tmp - 2) / 2));
  }
  myout(myconv(output,9));
}


function Main(input) {
  input = input.trim().split("\n").map(function(x) { return x.split(" ")});
  var N = parseInt(input[0],10);
  var vec_A = input[1].map(e => (parseInt(e, 10)));
  var eachNumCount = Array.from({length: N}, () => 0);
  var pairCount = Array.from({length: N}, () => 0);
  var sumPair, tmp;
  var ans = [];
  for (var i = 0; i < N; i++){
    eachNumCount[vec_A[i]-1] ++;
    pairCount[vec_A[i]-1] = (eachNumCount[vec_A[i]-1] * (eachNumCount[vec_A[i]-1] - 1) / 2)
  }
  sumPair = sum(pairCount);
  for (var i = 0; i < N; i++){
    tmp = eachNumCount[vec_A[i]-1]
    if (tmp === 0) ans.push(sumPair)
    else ans.push(sumPair - (tmp * (tmp - 1) / 2) + ((tmp - 1) * (tmp - 2) / 2));
  }
  console.log(ans.join('\n'));
}

var sum  = function(arr) {
  var sum = 0;
  arr.forEach(function(elm) {
      sum += elm;
  });
  return sum;
};

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


"use strict";
const combi = function(n){
    return n*(n-1)/2
}

const main = arg => {
    const input = arg.trim().split("\n");

    const N = parseInt(input[0].split(" ")[0]);
    const A = input[1].split(" ").map(n => parseInt(n));

    let m = {}
    for(let i = 0; i<A.length; i++){
        if(!m[A[i]]) m[A[i]] = 1
        else m[A[i]]++
    }
    let orgCnt = 0
    let keys = Object.keys(m)
    for(let i = 0; i<keys.length; i++){
        orgCnt = orgCnt + combi(m[keys[i]])
    }

    let out = ""
    for(let i = 0; i<A.length; i++){
        let num = m[A[i]]
        const diff = combi(num) - combi(num-1)

        out = out + String(orgCnt-diff)+"\n"
    }
    console.log(out)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function Main(input) {
  input=input.split("\n");
  var array=input[1].split(' ').map(e=>{
    return e-0;
  });
  var number=new Array(Math.max(...array)+1);
  number.fill(0);
  array.forEach(e=>{
    number[e]++;
  });
  var sum=0;
  number.forEach(e=>{
    sum+=e*(e-1)/2;
  });
  array.forEach(e=>{
    console.log(sum-number[e]+1);
  });
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const input = require("fs").readFileSync("/dev/stdin", "utf8")

;(input => {

    const lines = input.split('\n')
    const N = lines[0] - 0
    const A = lines[1].split(' ').map(Number)

    const m = Array(N + 1).fill(0)
    for (let i = 0; i < N; i++) {
        m[A[i]]++
    }

    const f = (n, m, d = 1) => {
        let sum = n
        let add = n
        for (let i = 1; i < m; i++) {
            add += d
            sum += add
        }
        return sum
    }

    let s = 0
    for (let i = 0; i < N; i++) {
        if (m[i] < 2) continue
        s += f(1, m[i] - 1)
    }

    for (let k = 0; k < N; k++) {
        const ans = s - (m[A[k]] - 1)
        console.log(ans)
    }

})(input)


const main = (input) => {
  input = input.trim().split('\n')
  const N = parseInt(input[0], 10)
  const nums = input[1].split(' ')

  const x = {}
  const cache = {}
  let sum = 0
  for (let i = 0; i < N; i++) x[nums[i]] = ~~x[nums[i]] + 1
  for (let [k, v] of Object.entries(x)) {
    if (v < 2) {
      delete x[k]
    } else {
      sum += v*(v-1) / 2
    }
  }

  for (let i = 0; i < N; i++) {
    console.log(sum === 0 ? 0 : sum - Math.max(0, x[nums[i]] - 1))
  }

  // nums.forEach(v => {
  //   x[v] -= 1
  //
  //   if (!cache[v]) {
  //     let sum = 0
  //     Object.keys(x).forEach(o => sum += (x[o] > 1) ?  c(x[o], 2) : 0)
  //     cache[v] = sum
  //   }
  //   console.log(cache[v])
  //
  //   x[v] += 1
  // })
}

const _cmb = (a, b) => {
  let numerator = 1
  for (let i = 0; i < b; i++) {
    numerator *= a
    a--
  }

  let denominator = 1
  while (b > 0) {
    denominator *= b
    b--
  }

  return numerator / denominator
}

const memo = (fn) => {
  const cache = {}
  return (a, b) => {
    if (!cache[`${a}c${b}`]) cache[`${a}c${b}`] = fn(a, b)
    return cache[`${a}c${b}`]
  }
}

const c = memo(_cmb)

process.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))


package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())
	return num
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()

	ans := make([]int, n+1)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = nextInt()
		ans[a[i]]++
	}

	total := 0
	for i := 0; i < n; i++ {
		if ans[i+1] != 0 {
			total += ans[i+1] * (ans[i+1] - 1) / 2
		}
	}

	wb := bufio.NewWriter(os.Stdout)
	defer wb.Flush()
	for i := 0; i < n; i++ {
		if ans[a[i]] == 0 {
			fmt.Fprintln(wb, 0)
		} else {
			temp := ((ans[a[i]] - 1) * (ans[a[i]] - 2) / 2) - (ans[a[i]] * (ans[a[i]] - 1) / 2)
			fmt.Fprintln(wb, total+temp)
		}
	}

}


//problem_d.go

package main

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

const (
	mod = int(1e9) + 7
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

// -----------------------------------------

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntSlice(n int) []int {
	ns := []int{}
	for i := 0; i < n; i++ {
		ns = append(ns, getInt())
	}
	return ns
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func getStringSlice(n int) []string {
	ss := []string{}
	for i := 0; i < n; i++ {
		ss = append(ss, getString())
	}
	return ss
}

// -----------------------------------------

// Sort Fanction

func sortIntSlice(ns []int) []int {
	sort.Sort(sort.IntSlice(ns))
	return ns
}

func rsortIntSlice(ns []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(ns)))
	return ns
}

// -----------------------------------------

// Num Fanction

//numModPow(a, n, m) == a^n % m
func numModPow(a int, n int, m int) int {
	result := 1

	for n > 0 {
		if n%2 == 1 {
			result = (result * a) % m
		}

		a = (a * a) % m
		n >>= 1
	}

	return result
}

// numGcd(a, b) == gcd(a, b)
func numGcd(a int, b int) int {
	if b == 0 {
		return a
	}

	return numGcd(b, a%b)
}

// numLcm(a, b) == lcm(a, b)
func numLcm(a int, b int) int {
	return a * b / numGcd(a, b)
}

// numModInv(a, p) == a^(-1) % p
func numModInv(a int, p int) int {
	if a == 1 {
		return 1
	} else {
		return p - numModInv(p%a, p)*(p/a)%p
	}
}

// -----------------------------------------

func solve() {

	n := getInt()
	ns := getIntSlice(n)

	var count_table [2*int(1e5) + 10]int
	s := 0

	for i := 0; i < n; i++ {
		count_table[ns[i]]++
	}

	for i := 1; i <= n; i++ {
		if count_table[i] >= 2 {
			s += count_table[i] * (count_table[i] - 1) / 2
		}
	}

	for i := 0; i < n; i++ {
		fmt.Fprintln(wr, s-(count_table[ns[i]]-1))
	}
}

// -----------------------------------------

func main() {
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)
	solve()
	wr.Flush()
}


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

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt(A ...*int) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.Atoi(L[i])
  }
}
func NextIntVec(A *[]int) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]int, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.Atoi(l)
  }
}
func NextFloat(A ...*float64) {
  L := strings.Split(NextLine(), " ")
  for i, a := range A {
    *a, _ = strconv.ParseFloat(L[i], 64)
  }
}
func NextFloatVec(A *[]float64) {
  L := strings.Split(NextLine(), " ")
  (*A) = make([]float64, len(L))
  for i, l := range L {
    (*A)[i], _ = strconv.ParseFloat(l, 64)
  }
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func MaxInt(A ...int) int {
  max := A[0]
  for _, a := range A {
    if max < a { max = a }
  }
  return max
}
func MinInt(A ...int) int {
  min := A[0]
  for _, a := range A {
    if a < min { min = a }
  }
  return min
}
func SumInt(A ...int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}

func Solve() {
  var N int
  NextInt(&N)
  var A []int
  NextIntVec(&A)
  B := make([]int, N + 1)
  for _, a := range A {
    B[a]++
  }
  C := make([][]int, 2)
  for i := range C { C[i] = make([]int, N + 1) }
  for i, b := range B {
    C[0][i] = b * (b - 1) / 2
    if 0 < b { C[1][i] = (b - 1) * (b - 2) / 2 }
  }
  S := SumInt(C[0]...)
  D := make([]int, N + 1)
  for i := range D {
    D[i] = S - C[0][i] + C[1][i]
  }
  for _, a := range A {
    Write(D[a])
  }
}

func main() {
  Solve()
  Output()
}


package main

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

func main() {
	scan_init()
	n:= scanInt()
	a:=make([]int, n)
	memo := make(map[int]int)
	for i:= 0; i<n; i++ {
		a[i] = scanInt()
		if _,ok := memo[a[i]]; !ok {
			memo[a[i]] = 0
		}
		memo[a[i]]++
	}
	// fmt.Println("aa")
	for i:= 0; i<n; i++ {
		sum := 0
		memo[a[i]]--
		for _,value := range  memo {
			if value == 1 || value == 0 {
				continue
			}
			sum += (value*(value-1))/2
		}
		fmt.Println(sum)
		memo[a[i]]++
	}

}

var sc = bufio.NewScanner(os.Stdin)

func scan_init() {
	sc.Split(bufio.ScanWords)
}
func scanInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func scan() string {
	sc.Scan()
	return sc.Text()
}

var rdr = bufio.NewReaderSize(os.Stdin, 200000)

func readLine() string {
	buf := make([]byte, 0, 200000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}
func readLineToNumber() int {
	S := readLine()
	number, _ := strconv.Atoi(S)
	return number
}
func readLineToSlice() []string {
	S := readLine()
	list := strings.Split(S, "")
	return list
}
func readLineToNumberSlice(memo map[string]int) []int {
	// err時は-1を代入
	S := readLine()
	intList := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if val, ok := memo[string(S[i])]; ok {
			intList[i] = val
		} else {
			intList[i] = -1
		}
	}
	return intList
}


package main

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

func main() {
	N := ReadInt()
	A := ReadInts(N)
	m := make(map[int]int)
	for _, ai := range A {
		m[ai]++
	}
	for _, ai := range A {
		m[ai]--
		c := 0
		for _, v := range m {
			if v > 1 {
				c += v * (v - 1) / 2
			}
		}
		m[ai]++
		fmt.Println(c)
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	var i int
	if sc.Scan() {
		if num, err := strconv.Atoi(sc.Text()); err == nil {
			i = num
		}
	}
	return i
}

// O(N^2)
// 配列Aを作成
// 数値に対して、値の出現数を記録したハッシュテーブルを作成
// ハッシュテーブルの値に対して、組み合わせ数を記録したハッシュテーブルを作成

func fact(n int) int {
	if n == 0 {
		return 1
	}
	a := 1
	for n != 0 {
		a *= n
		n = n - 1
	}
	return a
}

func combinationTwo(a int) int {
	if a == 0 || a == 1 {
		return 0
	}
	if a == 2 {
		return 1
	}
	return fact(a) / (2 * fact((a - 2)))
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	var a = make([]int, n)
	var values = make(map[int]int)
	var combinations = make(map[int]int)
	var all int
	for i := 0; i < n; i++ {
		a[i] = nextInt()
		values[a[i]]++
	}
	for k, v := range values {
		combi := combinationTwo(v)
		combinations[k] = combi
		all += combi
	}
	for i := 0; i < n; i++ {
		k := a[i]
		balls := values[k] - 1
		combi := combinations[k]
		newCombi := combinationTwo(balls)
		pattern := all + newCombi - combi
		fmt.Println(pattern)
	}
}


def main(str)
  lines = str.split("\n").map { |x| x.split(' ').map(&:to_i) }
  _n = lines[0][0]
  as = lines[1]
  counts = as.each_with_object(Hash.new(0)) { |x, m| m[x] += 1 }
  counts_sum = counts.values.map { |x| (x * (x-1))/ 2 }.sum
  as.map do |a|
    val = counts[a]
    counts_sum - (val * (val - 1)) / 2 + ((val - 1) * (val - 2)) / 2
  end.join("\n")
end

unless ENV["TEST"]
  puts(main($stdin.read.chomp))
  exit(0)
end

require 'minitest/autorun'

class TestA < Minitest::Test
  def test_main
    assert_equal("2
2
3
2
3", main("5
1 1 2 1 2"))
    assert_equal("0
0
0
0", main("4
1 2 3 4"))
    assert_equal("6
6
6
6
6", main("5
3 3 3 3 3"))
    assert_equal("5
7
5
7
7
5
7
5", main("8
1 2 1 4 2 1 4 1"))
  end
end


N = gets.to_i
num = gets.strip.split.map(&:to_i)
i = 0
ary = Array.new(N,0)
while i < N do
  ary[num[i]-1] += 1
  i += 1
end
sum = 0
j = 0
while j < N do
  sum += ary[j]*(ary[j]-1)/2 #すべての場合
  j += 1
end
k = 0
while k < N do
  puts sum-ary[num[k]-1]+1
  k += 1
end


class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)
  def initialize
    @n = gets.to_s.to_i
    @a = gets.to_s.split.map{ |v| v.to_i }
    @h = a.tally
    @t = h.map{|k,v|v*(v-1)/2}.sum
  end

  def solve
    n.times.map do |i|
      t - h[a[i]] + 1
    end
  end

  def show(ans)
    ans.each do |v|
      puts v
    end
  end
end

Problem.new.instance_eval do
  show(solve)
  # pp self
end

# n * (n-1) / 2
# - (n-1) * (n-2) / 2
# = n-1


n=gets.to_i
a=gets.split.map(&:to_i)
h=Hash.new(0)
a.each{|i|h[i]+=1}
a.each do |i|
  ans=0
  h.each do |k,c|
    c-=1 if k == i
    ans+=c*(c-1)/2
  end
  puts ans
end


n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
    hash[i] += 1
end
hash_2 = Hash.new(0)
arr = Array.new(n+1,0)
count = 0
hash.each do |i|
    #p i
    ans =  (i[1] * (i[1] - 1)) / 2
    hash_2[i[0]] = ans
    #p ans
    count += ans
end
p hash_2
a.each do |j|
    point = hash_2[j]
   # p point
  # puts "UU"
  # p j
    sa_1 = (hash[j] * (hash[j] - 1)) / 2
    #p sa_1
    sa_2 = [((hash[j]-1) * (hash[j] - 2)) / 2,0].max
    #p sa_2
    count = count - sa_1 + sa_2
    puts count
    count = count + (sa_1 - sa_2)
    #puts count
    #puts "KKK"
end


n = gets.chomp.to_i
a = gets.chomp.split(" ").map(&:to_i)
hash = Hash.new(0)
a.each do |i|
    hash[i] += 1
end
n.times do |j|
    hash[a[j]] -= 1
    count = 0
    hash.each do |i|
        ans =  (i[1] * (i[1] - 1)) / 2
        count += ans
    end
    puts count
    hash[a[j]] += 1
end


#![allow(unused_macros)]

#[allow(dead_code)]
mod utils {
    use std::collections::{HashMap, HashSet};
    use std::hash::{BuildHasherDefault, Hash, Hasher};
    use std::io::{
        self, BufRead, BufReader, BufWriter, Seek, SeekFrom, Stdin, StdinLock, Stdout, StdoutLock,
        Write,
    };
    use std::mem;
    use std::ops::{Deref, DerefMut};
    use std::ptr;
    use std::slice;
    use std::str::{self, FromStr};

    #[inline]
    fn is_space_or_line_break(b: &u8) -> bool {
        *b == b' ' || *b == b'\n'
    }

    pub struct Scanner<R: BufRead> {
        reader: R,
        buf: Vec<u8>,
    }

    impl<R: BufRead> Scanner<R> {
        #[inline]
        pub fn new(reader: R) -> Scanner<R> {
            Scanner {
                reader: reader,
                buf: Vec::with_capacity(100),
            }
        }

        pub fn read<T: FromStr>(&mut self) -> T {
            self.read_until(is_space_or_line_break);
            self.parse()
        }

        pub fn read2<T1: FromStr, T2: FromStr>(&mut self) -> (T1, T2) {
            (self.read(), self.read())
        }

        pub fn read3<T1: FromStr, T2: FromStr, T3: FromStr>(&mut self) -> (T1, T2, T3) {
            (self.read(), self.read(), self.read())
        }

        pub fn read4<T1: FromStr, T2: FromStr, T3: FromStr, T4: FromStr>(
            &mut self,
        ) -> (T1, T2, T3, T4) {
            (self.read(), self.read(), self.read(), self.read())
        }

        pub fn reads(&mut self) -> &str {
            self.read_until(is_space_or_line_break);
            unsafe { str::from_utf8_unchecked(&self.buf) }
        }

        pub fn readl(&mut self) -> &str {
            self.buf.clear();
            self.reader.read_until(b'\n', &mut self.buf).unwrap();
            let bytes = if self.buf.last() == Some(&b'\n') {
                &self.buf[..self.buf.len() - 1]
            } else {
                &self.buf
            };
            unsafe { str::from_utf8_unchecked(&bytes) }
        }

        pub fn read_vec<T: FromStr>(&mut self, count: usize) -> Vec<T> {
            (0..count).map(|_| self.read()).collect()
        }

        fn read_until<P: FnMut(&u8) -> bool>(&mut self, mut predicate: P) {
            self.buf.clear();
            let mut first = true;

            // https://doc.rust-lang.org/src/std/io/mod.rs.html#1623-1649
            loop {
                let (done, used) = {
                    let available = self.reader.fill_buf().unwrap();
                    if first && available.len() == 0 {
                        panic!("Scan Error (EOF reached)");
                    }

                    match available.iter().position(&mut predicate) {
                        Some(0) if first => (false, 1),
                        Some(i) => {
                            self.buf.extend_from_slice(&available[..i]);
                            (true, i + 1)
                        }
                        None => {
                            self.buf.extend_from_slice(available);
                            (false, available.len())
                        }
                    }
                };

                self.reader.consume(used);
                if done || used == 0 {
                    return;
                }

                first = false;
            }
        }

        #[inline]
        fn parse<T: FromStr>(&mut self) -> T {
            // 文字列をT型へパースする
            let elem = unsafe { str::from_utf8_unchecked(&self.buf) };
            elem.parse()
                .unwrap_or_else(|_| panic!(format!("failed parsing: {}", elem)))
        }
    }

    impl<R: BufRead + Seek> Seek for Scanner<R> {
        #[inline]
        fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
            self.reader.seek(pos)
        }
    }

    pub struct StdinScanner {
        stdin: Stdin,
        scanner: Scanner<BufReader<StdinLock<'static>>>,
    }

    impl StdinScanner {
        #[inline]
        pub fn new() -> StdinScanner {
            let stdin = io::stdin();
            let stdinlock = unsafe { mem::transmute(stdin.lock()) };
            let reader = BufReader::with_capacity(4096, stdinlock);
            let scanner = Scanner::new(reader);
            StdinScanner {
                stdin: stdin,
                scanner: scanner,
            }
        }
    }

    impl Deref for StdinScanner {
        type Target = Scanner<BufReader<StdinLock<'static>>>;

        #[inline]
        fn deref(&self) -> &Self::Target {
            &self.scanner
        }
    }

    impl DerefMut for StdinScanner {
        #[inline]
        fn deref_mut(&mut self) -> &mut Self::Target {
            &mut self.scanner
        }
    }

    pub struct StdoutWriter {
        stdout: Stdout,
        writer: BufWriter<StdoutLock<'static>>,
    }

    impl StdoutWriter {
        #[inline]
        pub fn new() -> StdoutWriter {
            let stdout = io::stdout();
            let stdoutlock = unsafe { mem::transmute(stdout.lock()) };
            let writer = BufWriter::with_capacity(4096, stdoutlock);
            StdoutWriter {
                stdout: stdout,
                writer: writer,
            }
        }

        pub fn write<T: FastDisplay>(&mut self, v: T) {
            v.display(&mut self.writer);
        }

        pub fn writeln<T: FastDisplay>(&mut self, v: T) {
            v.display(&mut self.writer);
            self.writer.write_all(b"\n").unwrap();
        }

        pub fn write_horizontal<I>(&mut self, iter: I)
        where
            I: IntoIterator,
            I::Item: FastDisplay,
        {
            let mut it = iter.into_iter();
            if let Some(elem) = it.next() {
                elem.display(&mut self.writer);
            } else {
                return;
            }

            for elem in it {
                elem.display(&mut self.writer);
                self.writer.write_all(b" ").unwrap();
            }
        }

        pub fn write_vertical<I>(&mut self, iter: I)
        where
            I: IntoIterator,
            I::Item: FastDisplay,
        {
            let mut it = iter.into_iter();
            if let Some(elem) = it.next() {
                elem.display(&mut self.writer);
            } else {
                return;
            }

            for elem in it {
                elem.display(&mut self.writer);
                self.writer.write_all(b"\n").unwrap();
            }
        }
    }

    impl Write for StdoutWriter {
        #[inline]
        fn flush(&mut self) -> io::Result<()> {
            self.writer.flush()
        }

        #[inline]
        fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
            self.writer.write(buf)
        }
    }

    #[derive(Clone)]
    pub struct FNVHasher(u64);

    impl Default for FNVHasher {
        fn default() -> FNVHasher {
            FNVHasher(0xcbf29ce484222325)
        }
    }

    impl Hasher for FNVHasher {
        #[inline]
        fn write(&mut self, bytes: &[u8]) {
            let FNVHasher(mut hash) = *self;

            for byte in bytes.iter() {
                hash = hash ^ (*byte as u64);
                hash = hash.wrapping_mul(0x100000001b3);
            }

            *self = FNVHasher(hash);
        }

        #[inline]
        fn finish(&self) -> u64 {
            self.0
        }
    }

    pub type FNVSet<T> = HashSet<T, BuildHasherDefault<FNVHasher>>;
    pub type FNVMap<K, V> = HashMap<K, V, BuildHasherDefault<FNVHasher>>;

    #[inline]
    pub fn fnvset_new<T: Eq + Hash>() -> FNVSet<T> {
        FNVSet::<T>::with_hasher(BuildHasherDefault::default())
    }

    #[inline]
    pub fn fnvset_with_capacity<T: Eq + Hash>(n: usize) -> FNVSet<T> {
        FNVSet::<T>::with_capacity_and_hasher(n, BuildHasherDefault::default())
    }

    #[inline]
    pub fn fnvmap_new<K: Eq + Hash, V>() -> FNVMap<K, V> {
        FNVMap::<K, V>::with_hasher(BuildHasherDefault::default())
    }

    #[inline]
    pub fn fnvmap_with_capacity<K: Eq + Hash, V>(n: usize) -> FNVMap<K, V> {
        FNVMap::<K, V>::with_capacity_and_hasher(n, BuildHasherDefault::default())
    }

    static DEC_DIGITS_LUT: &'static [u8; 200] = b"0001020304050607080910111213141516171819\
            2021222324252627282930313233343536373839\
            4041424344454647484950515253545556575859\
            6061626364656667686970717273747576777879\
            8081828384858687888990919293949596979899";

    #[allow(deprecated)]
    fn write_int<W: Write>(mut writer: W, mut n: u64, is_negative: bool) {
        unsafe {
            let mut buf: [u8; 39] = mem::uninitialized();
            let buf_ptr_start = buf.as_mut_ptr().offset(39);
            let mut buf_ptr = buf_ptr_start;
            let lut_ptr = DEC_DIGITS_LUT.as_ptr();

            while n >= 10000 {
                let rem = (n % 10000) as isize;
                n /= 10000;

                let d1 = (rem / 100) << 1;
                let d2 = (rem % 100) << 1;
                buf_ptr = buf_ptr.offset(-4);
                ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr, 2);
                ptr::copy_nonoverlapping(lut_ptr.offset(d2), buf_ptr.offset(2), 2);
            }

            let mut n = n as isize; // possibly reduce 64bit math

            // decode 2 more chars, if > 2 chars
            if n >= 100 {
                let d1 = (n % 100) << 1;
                n /= 100;
                buf_ptr = buf_ptr.offset(-2);
                ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr, 2);
            }

            // decode last 1 or 2 chars
            if n < 10 {
                buf_ptr = buf_ptr.offset(-1);
                *buf_ptr = (n as u8) + b'0';
            } else {
                let d1 = n << 1;
                buf_ptr = buf_ptr.offset(-2);
                ptr::copy_nonoverlapping(lut_ptr.offset(d1), buf_ptr, 2);
            }

            if is_negative {
                buf_ptr = buf_ptr.offset(-1);
                *buf_ptr = b'-';
            }

            let buf_slice =
                slice::from_raw_parts(buf_ptr, buf_ptr_start as usize - buf_ptr as usize);

            writer.write_all(buf_slice).unwrap();
        }
    }

    pub trait FastDisplay {
        fn display<W: Write>(&self, writer: &mut W);
    }

    impl FastDisplay for str {
        #[inline]
        fn display<W: Write>(&self, writer: &mut W) {
            writer.write_all(self.as_bytes()).unwrap()
        }
    }

    impl FastDisplay for String {
        #[inline]
        fn display<W: Write>(&self, writer: &mut W) {
            writer.write_all(self.as_bytes()).unwrap()
        }
    }

    macro_rules! impl_fastdisplay_int {
        ($($int:ty)*) => {
            $(
                impl FastDisplay for $int {
                    #[allow(unused_comparisons)]
                    fn display<W: Write>(&self, writer: &mut W) {
                        let is_negative = !(*self >= 0);
                        let abs = if is_negative {
                            (!*self as u64).wrapping_add(1)
                        } else {
                            *self as u64
                        };
                        write_int(writer, abs, is_negative);
                    }
                }
            )*
        };
    }

    macro_rules! impl_fastdisplay_float {
        ($($float:ty)*) => {
            $(
                impl FastDisplay for $float {
                    #[inline]
                    fn display<W: Write>(&self, writer: &mut W) {
                        write!(writer, "{}", *self).unwrap();
                    }
                }
            )*
        }
    }

    impl_fastdisplay_int!(u8 u16 u32 u64 usize i8 i16 i32 i64 isize);
    impl_fastdisplay_float!(f32 f64);
}

fn main() {
    let mut scanner = utils::StdinScanner::new();
    let mut writer = utils::StdoutWriter::new();

    let n: usize = scanner.read();

    let a: Vec<u32> = scanner.read_vec(n);
    let mut counts = vec![0u64; n];

    let mut total = 0;

    for ai in &a {
        total += counts[*ai as usize - 1];
        counts[*ai as usize - 1] += 1;
    }

    for ai in &a {
        let count = counts[*ai as usize - 1];
        writer.writeln(total - count + 1);
    }
}


#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, [ $t:tt ]) => {{
    let len = read_value!($iter, usize);
    (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  }};

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    n: usize,
    a: [usize1; n],
  }
  let mut popl = vec![0i64; n];
  for &x in &a {
    popl[x] += 1;
  }
  let mut all = 0;
  for i in 0 .. n {
    all += popl[i] * (popl[i] - 1) / 2;
  }
  for i in 0 .. n {
    puts!("{}\n", all - popl[a[i]] + 1);
  }
}