Petya studies positional notations. He has already learned to add and subtract numbers in the systems of notations with different radices and has moved on to a more complicated action — multiplication. To multiply large numbers one has to learn the multiplication table. Unfortunately, in the second grade students learn only the multiplication table of decimals (and some students even learn it in the first grade). Help Petya make a multiplication table for numbers in the system of notations with the radix k.

The first line contains a single integer k (2 ≤ k ≤ 10) — the radix of the system.

Output the multiplication table for the system of notations with the radix k. The table must contain k - 1 rows and k - 1 columns. The element on the crossing of the i-th row and the j-th column is equal to the product of i and j in the system of notations with the radix k. Each line may have any number of spaces between the numbers (the extra spaces in the samples are put for clarity).

def b(n, k):
    v = ''
    while n:
        n, v = n // k, str(n % k) + v
    return v
k = int(input())
for i in range(1, k):
    print(' '.join(b(i * j, k) for j in range(1, k)))

radix = int(input())
for i in range(1, radix):
  row = []
  for j in range(1, radix):
    x = i * j
    digits = []
    while x != 0:
      digits.append(str(x % radix))
      x //= radix
    row.append(''.join(reversed(digits)))
  print(' '.join(row))

k=int(input())
for i in range(1,k):
    z,a=i,[]
    for j in range(k-1):
        p,s=z,""
        while p:
            s=str(p%k)+s
            p//=k
        z+=i
        a.append(s)
    print(*a)

n=int(input())
for i in range(1,n):
    for j in range(1,n):
        c=i*j
        d=[]
        while(c!=0):
            d.append(str(c%n))
            c=int(c/n)
        d.reverse()

        d="".join(d)
        print(d,end=" ")
    print()

n = int(input())

for i in range(1,n):
    print(*((i*j//n)*10+(i*j%n) for j in range(1,n)))

def baseNum(a,b):
    i = 0
    sumV = []
    while a > 0:
        sumV.append(str(a % b) )
        a = int(a/b)
        i += 1
    res = sumV[::-1]
    res2 = "".join(res)
    res2 = int(res2)
    return res2
k = int(input())
for i in range(1,k):
    for j in range(1,k):
        print(baseNum(i*j,k),end=" " )
    print(end="\n")

n = int(input())
f = lambda x: x if x < n else f(x // n) * 10 + x % n
for i in range(1, n): print(*[f(i * j) for j in range(1, n)])

n = int(input())
for i in range(1, n): print(*[(i * j // n) * 10 + (i * j % n) for j in range(1, n)])

def convert_base(number, base):
    if base < 2:
        return False
    remainders = []
    while number > 0:
        remainders.append(str(number % base))
        number //= base
    remainders.reverse()
    return ''.join(remainders)
n = int(input())
for i in range(1,n):
  s = ''
  for j in range(1,n):
    s += str(convert_base(i * j, n)) + ' '
  s = s[:-1]
  print(s)

def t(x,n):
  if x<n:return x
  return t(x/n,n)*10+x%n
n=input()
for i in xrange(1,n):
  print ' '.join(map(str,[t(i*j,n) for j in xrange(1,n)]))

def BaseToString (element,base,symbols):
    if element < base:
        return symbols[element]
    else:
        return BaseToString(element/base,base,symbols) + symbols[element%base]
radix = input(); symbols = "0123456789"
row = []
for i in range (1,radix):
    row.append(i)
for item in row:
    for j in row:
        print BaseToString(item*j,radix,symbols),"",
    print ""

# def f(x,b):
# 	s = ""
# 	while x > b:
# 		s += str(x/b)
# 		x /= b
# 	s += str(x)
# 	return s

def digit_to_char(digit):
    if digit < 10:
        return str(digit)
    return chr(ord('a') + digit - 10)

def str_base(number,base):
    if number < 0:
        return '-' + str_base(-number, base)
    (d, m) = divmod(number, base)
    if d > 0:
        return str_base(d, base) + digit_to_char(m)
    return digit_to_char(m)

n = input()
for i in range(1,n):
	for j in range(1,n):
			# print '%2d'%f(i*j,n),
			print str_base(i*j,n),
	print

def CS(n, k):
    a = ""
    while not n == 0:
        l = n % k
        a = str(l) + a
        n /= k
    return a

k = int(raw_input())

for i in range(1, k):
    for j in range(1, k):
        print CS(i * j, k),
    print

def zetom(a,b):
    res=''
    s=a
    while s/b>0:
        res+=str(s%b)
        s=s/b
    res+=str(s)
    t=res[::-1]
    return t

k=input()

for i in range(1,k):

    for j in range(1,k):
        res=i*j
        if res>=k:
            res=zetom (res,k)
        print res,
    print

# -*- coding: utf-8 -*-
import sys

def func1(n,base):
    str1 = ""
    while True:
        if n/base == 0:
            str1 += str(n)
            break
        else:
            str1 += str(n%base)
            n /= base

    return str1[::-1]

if __name__ == '__main__':

    num = map(int,sys.stdin.readline().split())

    for v in range(1,num[0]):
        for u in range(1,num[0]):
            print func1(v*u,num[0]),
        print ""

import sys

base = int(sys.stdin.readline())

def baseN(num, b, numerals="0123456789"):
    return ((num == 0) and  "0" ) or ( baseN(num // b, b).lstrip("0") + numerals[num % b])

for i in range(1, base):
	for j in range(1, base):
		if j != 1:
			sys.stdout.write(" ")
		n = (i * j)
		if base != 10:
			n = int(baseN(n, base))
		sys.stdout.write("%d" % n)
	sys.stdout.write("\n")

n = int(raw_input())

def basen(val, base):
    res = ""
    while val > 0:
        res += str(val % base)
        val -= val % base
        val /= base
    return res[::-1]

for x in range(n-1):
    for y in range(n-1):
        #Put x*y into base n
        print basen( (x+1) * (y+1), n), " ",
    print

n = int(raw_input())
def rad_n(n,x):
	r =''
	while x>=n:
		r=str(x%n)+r
		x = x/n
	r=str(x)+r
	return r
l = len(str(rad_n(n,(n-1)*(n-1))))
#print l
for i in xrange(1,n):
	for j in xrange(1,n):
		a = rad_n(n,i*j)
		if j==1:
			print a,
		elif j<n-1:
			print ' '*(l-len(a))+a,
		else:
			print ' '*(l-len(a))+a

#! /usr/bin/python

from string import *

def decimal2other(x , base ):
    res = ""
    while x > 0 :
        t = x % base
        x /= base
        res = str(t) + res
    return res

def multable( n ) :
    for x in range(1,n):
        for y in range(1,n):
            t = x*y
            p = decimal2other(t,n)
            if y+1 < n :
                print p,
            else :
                print p

if __name__ =="__main__" :
    n = int(raw_input())
    multable(n)

def sol(N, K):
	ret = ''
	while N != 0:
		ret = str(N % K) + ret
		N /= K
	return ret

N = int(raw_input())
for i in range(1, N):
	for j in range(1, N):
		print sol(i * j, N),
	print

def convertBase(n,  toBase, prevBase = 10):
	#najdi stevilko potence toBase^n ku je vecja, in zacni od ene manj
	str1 = str(n)

	i=1
	st = 0
	while i <= n:
		i *= toBase
		st += 1
	#print "st:%s" %st

	res = []
	tmpSt = st
	tmpN = n
	for i in range(0,st):
		if i == st-1:
			res.append(str(tmpN%toBase))
			return "".join(res)

		trCifra = 1
		for i in range(0,st-1-i):
			trCifra *= toBase

		deljeno = int(tmpN / trCifra)
		if deljeno >= 1:
			tmpN = tmpN - (deljeno*trCifra)
			res.append(str(deljeno))
		else:
			res.append("0")

base = int(raw_input())

for i in range(0,base-1):
	if i != base-2:
		print "%d " % (i+1),
	else:
		print "%d" % (i+1)

for i in range(1, base-1):
	print "%d " % (i+1),
	for j in range(1, base-1):
		rez = (i+1) * (j+1)
		if j != base-2:
			print "%d " % ( int(convertBase(rez,base)) ),
		else:
			print "%d" % ( int(convertBase(rez,base)) )

def toSys(n, k):
    res = ''
    t = k
    while (n != 0):
        res += str(n % t)
        n //= t
        t *= k
    return res[::-1]

n = int(input())
for i in range(1, n):
    for j in range(1, n):
        print(toSys(i * j, n), end=" ")
    print()

a=int(input())
def radix(x):
    k=[]
    while x:k.append(x%a);x=x//a
    return ''.join(map(str,k))[::-1]
for i in range(1,a):
    for j in range(1,a):print(radix(i*j),end=' ')
    print()

from sys import stdout
from sys import stdin
def get():
    return stdin.readline().strip()
def getf():
    return [int(i) for i in get().split()]
def put(a, end = "\n"):
    stdout.write(str(a) + end)
def putf(a, sep = " ", end = "\n"):
    stdout.write(sep.join(map(str, a)) + end)

def matrix(n, m, a = 0):
    return [[a for i in range(m)]for j in range(n)]

def transf(a, k):
    s = ""
    while(a >= k):
        s += str(a % k)
        a //= k
    s += str(a)
    return s[::-1]

def main():
    n = int(get())
    t = matrix(n - 1, n - 1)
    for i in range(1, n):
        for j in range(1, n):
            t[i - 1][j - 1] = transf(i*j, n)
    for i in t:
        putf(i)
main()

def convert(n,base):
    x=""
    while n>0:
        x+=str(n%base)
        n//=base
    return x[::-1]
def func(x,n):
    ans=[]
    ans.append(x)
    for i in range(2,n):
        ans.append(int(convert(x*i,n)))
    return ans
n=int(input())
ans=[]
for i in range(1,n):
    if i==1:
        x=[j for j in range(1,n)]
        ans.append(x)
    else:
        x=func(i,n)
        ans.append(x)
for s in ans:
    print(*s)

def b(n, k):
    v = 0
    while n:
        n, v = n // k, 10 * v + n % k
    return str(v)[::-1]
k = int(input())
for i in range(1, k):
    print(' '.join(b(i * j, k) for j in range(1, k)))

n = int(raw_input())
def rad_n(n,x):
	r =''
	while x>n:
		r=str(x%n)+r
		x = x/n
	r=str(x)+r
	return r
l = len(str(rad_n(n,(n-1)*(n-1))))
#print l
for i in xrange(1,n):
	for j in xrange(1,n):
		a = rad_n(n,i*j)
		if j==1:
			print a,
		elif j<n-1:
			print ' '*(l-len(a))+a,
		else:
			print ' '*(l-len(a))+a


Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself occupied. The box is special, since it has the ability to change gravity.There are n columns of toy cubes in the box arranged in a line. The i-th column contains ai cubes. At first, the gravity in the box is pulling the cubes downwards. When Chris switches the gravity, it begins to pull all the cubes to the right side of the box. The figure shows the initial and final configurations of the cubes in the box: the cubes that have changed their position are highlighted with orange.  Given the initial configuration of the toy cubes in the box, find the amounts of cubes in each of the n columns after the gravity switch!

The first line of input contains an integer n (1 ≤ n ≤ 100), the number of the columns in the box. The next line contains n space-separated integer numbers. The i-th number ai (1 ≤ ai ≤ 100) denotes the number of cubes in the i-th column.

Output n integer numbers separated by spaces, where the i-th number is the amount of cubes in the i-th column after the gravity switch.

NoteThe first example case is shown on the figure. The top cube of the first column falls to the top of the last column; the top cube of the second column falls to the top of the third column; the middle cube of the first column falls to the top of the second column.In the second example case the gravity switch does not change the heights of the columns.

n = int(input())
list_ = sorted(list(map(int, input().split())))
for val in list_:
    print(val, end=" ")

#coding: utf-8

n = int(raw_input())

l = map(int, raw_input().split())
l.sort()

saida1 = ''
for i in l:
    saida1 += str(i) + " "
saida1.strip()

print saida1

num_of_cols = int(input())
x = raw_input().split()

i = 0
j = 0
list1 = []
list2 = []

while i < num_of_cols:
    num_of_blocks = int(x[i])
    list1.append(num_of_blocks)
    i = i + 1

list1.sort()

while j < num_of_cols:
    list2.append(str(list1[j]))
    j = j + 1

print ' '.join(list2)

n = int(input())
l = [int(i) for i in input().split()]
l.sort()
str_l = [str(i) for i in l]
print(' '.join(str_l))

from sys import stdin

def main():
    input = stdin
    n = input.readline()
    m = input.readline().split()
    m = [int(x) for x in m]
    m.sort()
    m = [str(x) for x in m]
    m = ' '.join(m)
    print(m)
main()

n=int(input())
#print(' '.join(sorted(list(map(str,input().split())))))
print(*sorted(list(map(int,input().split()))))

#!/usr/bin/env python3

"""
A. Gravity Flip
http://codeforces.com/problemset/problem/405/A/

Sat, 5 Sep 2015
Python 3.4: 61 ms, 0 KB
"""

from sys import stdin

def main () :
    input()
    s = input()
    a = (int(v) for v in s.split())
    b = sorted(a)
    c = (str(v) for v in b)
    d = ' '.join(c)
    print(d)

if __name__ == "__main__" :
    main()

n = int(input())
a = list(map(int,input().split(" ")))
a.sort()
for i in a:
    print(i,end=" ")

#!/usr/bin/env Python3
m=input()
n=input()
cubes=n.split()
list1=map(int, cubes)
list2=map(str,sorted(list1))

print (' '.join(list2))

nums = int(input())
cols = [int(x) for x in input().split()]
cols.sort()
print(' '.join(str(num) for num in cols))

#!/usr/bin/env python

import math

def main():

	n = int(raw_input())
	v = raw_input().split(' ');

	v = [int(i) for i in v]

	while True:
		valid = False

		for i in range(0, n-1):
			if (v[i] > v[i+1]):
				diff = abs(v[i]-v[i+1])
				v[i] = v[i]-diff
				v[i+1] = v[i+1] + diff
				valid = True

		if (valid == False):
			break

	for i in v:
		print i,

main()

n = raw_input()

l = sorted([int(x) for x in raw_input().split()])

print " ".join([str(x) for x in l])

n = input()

set = input()
set=set.split(" ")
set=[int(num) for num in set]
set.sort()
set=[str(num) for num in set]

res=""

for num in set:
    res+=num+" "

print(res[0:-1])

#import time
#start_time = time.time()
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def quicksort(array):
   # https: // tutorialedge.net / compsci / sorting / quicksort - in -python /
    # We define our 3 arrays
    less = []
    equal = []
    greater = []

    # if the length of our array is greater than 1
    # we perform a sort
    if len(array) > 1:
        # Select our pivot. This doesn't have to be
        # the first element of our array
        pivot = array[0]

        # recursively go through every element
        # of the array passed in and sort appropriately
        for x in array:
            if x < pivot:
                less.append(x)
            if x == pivot:
                equal.append(x)
            if x > pivot:
                greater.append(x)

        # recursively call quicksort on gradually smaller and smaller
        # arrays until we have a sorted list.
        return quicksort(less) + equal + quicksort(greater)
    else:
        return array

input()
list = input().split(" ")
for i in range(0,len(list)):
    list[i] = int(list[i])

new_list = quicksort(list)
for i in range(0,len(new_list)):
    print(new_list[i], end = ' ')

#print("--- %s seconds ---" % (time.time() - start_time))

from sys import stdin,stdout
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))
n=int(input())
lis=gil()
lis.sort()
print(' '.join(map(str,lis)))

dlina=int(raw_input())
kubiki=raw_input()
kubiki=kubiki.split(' ')

for i in range(dlina):
    kubiki[i]=int(kubiki[i])

kubiki.sort()
for i in kubiki:
    print i,

def main():
    n = int(input())
    l = list(map(int, input().split()))
    l.sort()
    for x in l:
        print(x, end= ' ')

if __name__ == '__main__':
    main()

def ni():
    return int(raw_input())

def nis():
    return map(int, raw_input().split())

n = ni()
a = nis()

print ' '.join(map(str, sorted(a)))

n = int(raw_input())
array = map(int, raw_input().split())
array.sort()
print ' '.join(str(e) for e in array)

import sys

total = int(sys.stdin.readline().strip('\n').strip('\r'))
column = sys.stdin.readline().strip('\n').strip('\r').split(" ")
# maxn = int(max(column))
# solution = []
# final = []
#
for i in range(0, total):
    column[i] = int(column[i])
#
#
# for i in range(0, total):
#     solution.append([1 for j in range(0, column[i])])
#     for k in range(0, maxn - column[i]):
#         solution[i].append(0)
#
# # Contamos las veces que hay un 1 por columna
# totales = [0 for i in range(0, maxn)]
# for i in range(0, maxn):
#     for j in range(0, total):
#         totales[i] += solution[j][i]
#
# for i in range(0, total):
#     fin = [0 for i in range(0, maxn)]
#     for j in range(0, maxn):
#         if totales[j] > 0:
#             fin[j] += 1
#             totales[j] -= 1
#     final.insert(0, fin)
#
# result = []
# for i in range(total):
#     unos = 0
#     for j in range(0, maxn):
#         if final[i][j] == 1:
#             unos += 1
#     result.append(str(unos))
#
column.sort()
for i in range(0, total):
    column[i] = str(column[i])
r = ' '.join(column)
print(r)

n = int(raw_input())
lst = map(int, raw_input().split())
for i in range(n-1 , 0, -1):
    for j in range(i-1, -1, -1):
        if lst[i] < lst[j]:
            cur = lst[j] - lst[i]
            lst[i] = lst[i] + cur
            lst[j] = lst[j] - cur

print ' '.join(str(n) for n in lst)

n = int(input())
a = sorted(list(map(int, input().split())))
a = [str(i) for i in a]
print(" ".join(a))

#                               #
    # author : samars_diary #
    # 12-09-2020 │ 10:57:25 #
#                               #

import sys, os.path

if(os.path.exists('input.txt')):
    sys.stdin = open('input.txt',"r")
    #sys.stdout = open('output.txt',"w")

sys.setrecursionlimit(10 ** 5)

def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))

#print=sys.stdout.write

def solve():
    a=ii();b=lii();c=1
    while c!=a:
        c=1
        for i in range(a-1):
            if b[i]-b[i+1]>0:
                b[i],b[i+1]=b[i+1],b[i]
            else:
                c+=1
    print(' '.join([str(x) for x in b]))
solve()

# #                               #
#     # author : samars_diary #
#     # 12-09-2020 │ 10:57:25 #
# #                               #

# import sys, os.path

# if(os.path.exists('input.txt')):
#     sys.stdin = open('input.txt',"r")
#     #sys.stdout = open('output.txt',"w")

# sys.setrecursionlimit(10 ** 5)

# def i(): return sys.stdin.readline().strip()
# def ii(): return int(sys.stdin.readline())
# def li(): return list(sys.stdin.readline().strip())
# def mii(): return map(int, sys.stdin.readline().split())
# def lii(): return list(map(int, sys.stdin.readline().strip().split()))

# #print=sys.stdout.write

# def solve():
#     a=ii();b=lii();c=1
#     while c!=a:
#         c=1
#         for i in range(a-1):
#             if b[i]-b[i+1]>0:
#                 b[i],b[i+1]=b[i+1],b[i]
#             else:
#                 c+=1
#     print(*b, sep=' ')
# solve()

s=input()
t=input()
a=t.split(" ")
x=[]
for i in a:
    x.append(int(i))
z=sorted(x)
ans=" ".join(str(i) for i in z )
print(ans)

n = int(raw_input())

lista = raw_input().split()

for i in xrange(len(lista)):

	lista[i] = int(lista[i])

lista.sort()

saida = ''
for num in lista:

	saida += str(num) + ' '

print saida[:-1]

n=int(input())
l=list(map(int,input().split()))
l.sort()
for i in l:
    print(i,end=" ")

import sys

if __name__ == "__main__":
    count = int(sys.stdin.readline().rstrip())
    heights = [int(i) for i in sys.stdin.readline().rstrip().split(' ')]
    for i in reversed(range(len(heights))):
        j = i
        while j < len(heights) - 1 and heights[j] > heights[j + 1]:
            diff = heights[j] - heights[j + 1]
            heights[j + 1] += diff
            heights[j] -= diff
            j += 1
    for i in heights:
        print(i, end = " ")

colnum = int(input())

cols = raw_input().split()

x=0

if colnum == len(cols):
    cols = [int(i) for i in cols]
    cols.sort()
    print(' '.join(map(str, cols)))

n = int(raw_input())

lista = map(int, raw_input().split(" "))
lista.sort()
out = ""
for x in lista:
    out += str(x) + " "
print out

n = int(input())

arr = [int(i) for i in input().split()]

for i in range(n - 1):
    for j in range(n - 1, i, -1):
        diff = arr[i] - arr[j]

        if diff > 0:
            arr[j] += diff
            arr[i] -= diff

print(*arr)

import sys

boxInput = []
# boxInput.append("4")
# boxInput.append("3 2 1 2")
for line in sys.stdin:
    boxInput.append(line)

numCols = int(boxInput[0])
cols = []
for col in boxInput[1].split():
    cols.append(int(col))

for x in range(0, numCols):
    i = numCols - 1
    while i > 0:
        if cols[i] < cols[i-1]:
            diff = cols[i-1] - cols[i]
            cols[i] += diff
            cols[i-1] -= diff
        i -= 1

result = " ".join(`col` for col in cols)
# for x in range(0, numCols - 1):
#     result += "{} ".format(cols[x])
# result += "{}".format(cols[numCols-1])

print result

input()
print(' '.join(map(str, sorted(map(int, raw_input().split())))))

nums = int(input())
cols = [int(x) for x in input().split()]
cols.sort()
print(' '.join(str(num) for num in cols))

n=input()
a=map(int,raw_input().split())
a.sort()
for i in a:
    print i,

from sys import stdin

n = int(stdin.readline().rstrip())

col = stdin.readline().rstrip().split(' ')
nums = [int(v) for v in col]

nums.sort()

print(" ".join([str(w) for w in nums]))

m = str(raw_input())
g = map(int,raw_input().split())
g.sort()
for i in g:
	print i

n = input()
a = input()
a = a.split(' ')
for i in range(len(a)):
    a[i] = int(a[i])
a.sort()
for i in range(len(a)):
    print(a[i], end = ' ')

n = eval(input())
cubes = [int(x) for x in input().split()]
cubes.sort()
for i in range(n - 1):
    print(cubes[i],end = ' ')
print(cubes[n - 1])

no = str(raw_input())
cols = raw_input("")
fin = map(int,cols.split())
fin.sort()
for block in fin:
        print block,

no = str(raw_input())
chs = map(int,raw_input().split())
chs.sort()
for g in chs:
        print g,

from sys import stdin
n = stdin.readline()
arr = [int(x) for x in stdin.readline().split()]

print(*sorted(arr))

columns = raw_input()
entrada = raw_input()

array = entrada.split(" ")
int_array = [int(a) for a in array]
int_array.sort()
result = ""
for i in range(len(int_array)):
    result += str(int_array[i]) + " "
print result

n = input()
a = raw_input()
a = a.split()
a = [int(x) for x in a]
i=0
for b in range(n):
    i=0
    for el in a:
        if i == (n-1):
            break
        if a[i]>a[i+1]:
            z = a[i]
            a[i] = a[i+1]
            a[i+1] = z
           # print 'ok'
            #print a
        #else:
           #print 'no'

        i+=1
print ' '.join([str(x) for x in a])

n = int(input())
a = input().split()
x = []
for i in range (n):
    x.append(int(a[i]))
x.sort()
for i in range(n):
    print(x[i] , end=" ")

n = int(input())
x = [int(i) for i in input().split()]
x.sort()
print(' '.join([str(i) for i in x]))

n = input()
arr = map(int,raw_input().split())
arr.sort()
for x in arr :
	print x,

#!/usr/bin/env python
#-*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

N = int (raw_input ())
l = [int (i) for i in raw_input ().split ()]
G = []
x = []
while True:
    cnt = 0
    for i in range (N):
        if l [i]:
            l [i] -= 1
            cnt += 1
    if not cnt: break
    x.append (cnt)
m = max (x)
for i in x:
    G.append ([1] * i + [0] * (m - i))
ret = [0] * N
for j in range (len (G [0])):
    for i in range (len (G)):
        ret [j] += G [i][j]
ret.reverse()
print " ".join (str (i) for i in ret)

n = int(input())
cols = list(map(int, input().split()))
cols.sort()

for col in cols:
    print(col, end=" ")

n = int(input())
s = list(map(int, input().split()))
for i in range(n):
    for j in range(n-1 ):
        if s[j] > s[j+1]:
            s[j], s[j+1] = s[j+1], s[j]
print(*s)

_input = input('')

_list = sorted(list(map(int, input().split())))
print(*_list)

input()
x = sorted(map(int,raw_input().split()))
for i in x:
	print `i`

"""
Gravity Flip Problem Resolution.
"""
# Packages and Libraries.
import sys

# Function definitions.
def quicksort(arr):
    lesser = []
    equal = []
    greater = []
    if len(arr)>1:
        pivot = arr[len(arr)-1]
        start = 0
        while start<len(arr):
            if arr[start] > pivot:
                greater.append(arr.pop(start))
            elif arr[start] < pivot:
                lesser.append(arr.pop(start))
            else:
                start = start + 1
        return (quicksort(lesser) + arr + quicksort(greater))
    else:
        return (arr)

def my_sort(input_file):
    n = int(input_file.readline())
    a = [int(x) for x in input_file.readline().split()]
    a = quicksort(a)
    for val in a:
        print(val)

# Execution.
my_sort(sys.stdin)

def merge(arr1, arr2):
	l1, l2 = len(arr1), len(arr2)
	i, j, k = 0, 0, 0
	while i < l1 or j < l2:
		if i < l1 and j < l2:
			if arr1[i] < arr2[j]:
				yield arr1[i]
				i += 1
			else:
				yield arr2[j]
				j += 1
		elif i < l1 and j >= l2:
			yield arr1[i]
			i += 1
		else:
			yield arr2[j]
			j += 1
		k += 1
	return

def sort_cube(arr):
	if len(arr) < 2:
		return arr
	return list(merge(sort_cube(arr[0:len(arr)//2]), sort_cube(arr[len(arr)//2:])))
input()
cube = sort_cube(list(map(int, input().split())))
for column in cube:
	print(column, end = " ")

n = int(input())
l = sorted(list(map(int,raw_input().split())))
for i in l:
    print i,

from sys import stdin
"""
ORDENAMIENTO_3
OBJETIVO: ORDENAR UN VECTOR
YEISSON FABIAN GUALDRON VIVAS
04/04/2017
"""
#pre:recivir un vector como parametro
#pos:imprimir el mismo vector pero con sus elementos ordenados

def main():
    y=int(stdin.readline())
    lista=[int(x) for x in stdin.readline().split()]
    if y==1:
        print(lista[0])
    else:
        rang=1
        cont=0
        lista=order_r(lista,rang,cont)
        for i in lista:
            print(i,end=' ')

def order_r(lista,rang,cont):
    i=0
    lista=after(lista,(cont+1),(i))
    if rang <(len(lista)-1):
        cont+=1
        return order_r(lista,(rang+1),cont)
    else:
        return lista

def after(lista,cont,i):
    if lista[cont] < lista[i]:
        cache=lista[i]
        lista[i]=lista[cont]
        lista[cont]=cache
    if i<cont:
        return after(lista,cont,i+1)
    else:
        return lista

main()

n = int(raw_input())
m = raw_input()
m = m.split()
for i in range(len(m)):
    m[i] = int(m[i])
m.sort()
for i in m:
    print i

input()
b = [int(x) for x in input().split()]
b.sort()
x = map(str, b)
print(' '.join(x))

column = input()
cubesPerColumn = input().split()
orderedArrays = sorted(map(int, cubesPerColumn))

gravitySwitch = map(str, orderedArrays)
print (' '.join(gravitySwitch))

dlina=int(raw_input())
kubiki=raw_input()

if dlina == 1:
    print kubiki

else:
    kubiki=kubiki.split(' ')
    for i in range(dlina):
        kubiki[i]=int(kubiki[i])

    i=-2
    while i>=-dlina:
        j=i
        while j<=-2:
            if kubiki[j]>kubiki[j+1]:
                raznica=kubiki[j]-kubiki[j+1]
                kubiki[j]-=raznica
                kubiki[j+1]+=raznica
            j+=1
        i-=1
    for i in kubiki:
        print i,

n = int(input())
s = input().split()[:n]
s = [int(i) for i in s]
s.sort()
print(*s)

number_of_columns = int(input())
numbers = [int(i) for i in input().split(' ')]

numbers = [str(i) for i in sorted(numbers)]
print(' '.join(numbers).strip())

# coding: utf-8

n = int(raw_input())
height = map(int, raw_input().split())
height.sort()

for i in height:
	print i,

n = int (input())
s = list(map(int, input().split()))
for i in range(len(s)-1, 0 , -1):
    for j in range(i):
        if s[j] > s[j+1]:
            s[j], s[j+1] = s[j+1], s[j]
print(*s)

raw_input()
rows = [int(n) for n in raw_input().split(" ")]
print " ".join(str(n) for n in sorted(rows))

n = int(input())
s = input().split()
s = [int(i) for i in s]
s.sort()
s = [str(i)for i in s]
print(" ".join(s))

count = raw_input()
numbers = raw_input().split()
numbers.sort(key=int)

s = ""
for i in numbers:
	s = s + i + " "

print s

n = input()

set = input()
set=set.split(" ")
set=[int(num) for num in set]
set.sort()
set=[str(num) for num in set]

res=""

for num in set:
    res+=num+" "

print(res[0:-1])

n=input()
a=map(int,raw_input().split())
a.sort()
for x in a:
    print x,

A = int(input())
B = [int(x) for x in input().split()]
B.sort()
D = str(B[0])
for x in range(1, A):
    D = D + ' ' +str(B[x])
T = len(D)
print(D[0:T])

x = int(input())
y = list(sorted(map(int,input().split())))
print(*y)

# Kristian Radam 4CSA

n = int(raw_input())
assert(n >= 1 & n <= 100)

a = raw_input().split()
assert(len(a) == n)

i = 0
while (i < len(a)):
	a[i] = int(a[i])
	assert(a[i] >= 1 & a[i] <= 100)
	i += 1

stack = [0] * max(a)

i = 0
while(i < len(stack)):
	ctr = 0
	for x in a:
		if ((x - i) > 0):
			ctr += 1
	stack[i] = ctr
	i += 1

length = len(a)
a = [0] * len(a)
for t in stack:
	i = length - 1
	while (t != 0):
		a[i] += 1
		t -= 1
		i -= 1

print " ".join(map(str, a))

no = str(raw_input())
cols = raw_input("")
fin = map(int,cols.split())
fin.sort()
for block in fin:
        print block,

#!/usr/bin/env python3

# pylint: disable = bad-whitespace
# pylint: disable = invalid-name
# pylint: disable = missing-docstring

# --------------
# GravityFlip.py
# --------------

"""
A. Gravity Flip
http://codeforces.com/problemset/problem/405/A/

Mon, 25 Jan 2016
Python 3.5.1: 62 ms, 0 KB
"""

from sys import stdin

def test_case (a) :
    s = sorted(a)
    for v in s :
        print(v, end=" ")
    print()

#    c = [str(v) for v in b]
#    d = ' '.join(c)
#    print(d)

def main () :
    for _ in stdin :
        a = [int(v) for v in input().split()]
        test_case(a)

if __name__ == "__main__" :
    main()

n = int(input())
arr = [int(i) for i in input().split()]
store = {}
#counting sort
for i in range(n):
    try:
        store[arr[i]] += 1
    except:
        store[arr[i]] = 1

result = []
for j in range(101):
    try:
        result = result + [j] * store[j]
    except:
        pass

print(*result)

n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
print(*arr)

# Codeforces 405A: Gravity Flip

columns = int(raw_input())
cubes = map(int, raw_input().split())

for i in xrange(columns - 1):
    for j in xrange(columns - i - 1):
        if (cubes[j] > cubes[j + 1]):
            cubes[j], cubes[j + 1] = cubes[j + 1], cubes[j]

print " ".join(map(str, cubes))

n=input()
s=input()
l=[]
for i in map(int,s.split()):
    #print(i)
    l.append(i)

#print(l)
a=' '.join(map(str, sorted(l)))
print(a)

noc= int(raw_input())
cubes= raw_input().split()
cubes.sort(key=int)

print " ".join(str(x) for x in cubes)

n=int(input())
a=[int(i) for i in input().split()]
b=a
b.sort()
t=0
while b!=a:
    while t<len(a)-1:
        if a[len(a)-1-i]<a[len(a)-2-i]:
            a[len(a)-1-i]=a[len(a)-2-i]-a[len(a)-1-i]
        t+=1
    b=a
    b.sort()
b=[str(i) for i in a]
print(" ".join(b))

import sys
size = sys.stdin.readline()
columns = sys.stdin.readline().split()

for i in sorted(columns, key= int):
    print(i, end = " ")

_ = input()
cols = [int(x) for x in input().split()]
cols.sort()
for x in cols:
    print(x, end=" ")

#Code by Paul James Pionelo

colNum = input()
numPerCol = raw_input().split(" ")

#Get maximum height of box
maximum = 0
count = len(numPerCol)
counter = 0
while(counter < count):
    if(int(numPerCol[counter]) > maximum):
        maximum = int(numPerCol[counter])
    counter += 1

#Formulate the length x width of box
box = [[0 for y in xrange(maximum)] for x in xrange(colNum)]

#Formulate the shifted version of it
boxShift = [[0 for y in xrange(colNum)] for x in xrange(maximum)]

#List for final count of cubes
finalCount = [0]*colNum

#Put the cubes per column
counter = 0
while(counter < colNum):
    counterCube = 0

    while(counterCube < int(numPerCol[counter])):
        box[counter][counterCube] = 1
        counterCube += 1

    counter += 1

#   finalCount[counter]print(box)

#Shift gravittttyyyy!
counter = 0
shiftLength = len(boxShift)

while(counter < shiftLength):
    counterCube = 0

    #the main factor to shift the cube's gravity --- will be used as an index
    countMe = 0

    while(counterCube < colNum):

        if(box[counterCube][counter] == 1):
            boxShift[counter][countMe] = 1
            countMe += 1

        counterCube += 1

    counter += 1

#print(boxShift)

#Count per column (normal gravity)
counter = 0
while(counter < colNum):
    counterCube = 0

    while(counterCube < shiftLength):
        if(boxShift[counterCube][counter] == 1):
            finalCount[counter] += 1

        counterCube += 1

    counter += 1

finalCount.reverse()

#Convert the finalCount list's values to string
counter = 0
while(counter < colNum):
    finalCount[counter] = str(finalCount[counter])
    counter += 1

#print(finalCount)
print(" ".join(finalCount))

# Yambao, Christine Nyries L.
# 4CSB

n_columns = int(raw_input())
n_cubes_per_column = [int(x) for x in raw_input().split(' ')]

for i in range(n_columns - 1):
	for i in range(n_columns - 1):
		if n_cubes_per_column[i] > n_cubes_per_column[i + 1]:
			excess_cubes = n_cubes_per_column[i] - n_cubes_per_column[i + 1]
			n_cubes_per_column[i] -= excess_cubes
			n_cubes_per_column[i + 1] += excess_cubes

print ' '.join(str(x) for x in n_cubes_per_column)

n = input()
a = raw_input()
a = a.split()
a = [int(x) for x in a]
a.sort()
print ' '.join([str(x) for x in a])

n = int(input())
a = input().split()
x = []
for i in range (n):
    x.append(int(a[i]))
x.sort()
for i in range(n):
    print(x[i] , end=" ")

colNumber = input("")
cubes = map(int,raw_input().split())
cubes.sort() #gravity to right (ascending since column with highest number of boxest momove rin sa rightmost column
for num in cubes:
	print num,

n = int(input())
d = list(map(int, input().split()))
c = sorted(d)
for i in range(len(c)):
    print('{} '.format(c[i]))

n = int(input())
structure = input().split(" ")

for i in range(len(structure)):
    structure[i] = int(structure[i])

structure.sort()

final = ""
for i in range(len(structure)):
    if final == "":
        final += str(structure[i])
    else:
        final += (" " + str(structure[i]))

#!/usr/bin/env Python3
n=int(input())
m=input()

cubes=m.split()
cubes.sort()

print (' '.join(cubes))

colunas = int(raw_input())
lista = raw_input().split()
lista = [int(i) for i in lista]

matriz = []
for i in range(colunas):
	matriz.append([])
	for j in range(max(lista)):
		matriz[i].append(0)

for i in range(colunas):
	for j in range(lista[i]):
		matriz[i][j] = 1

new_pos = [0] * colunas
for i in range(colunas):
	for j in range(max(lista)):
		if matriz[i][j] == 1:
			new_pos[i] += 1

for i in new_pos:
	print i, ' ',

from sys import stdin

size = stdin.readline()
l = stdin.readline().split()

l.sort()
print(l)

import sys

inp = sys.stdin.readline()
inp = sys.stdin.readline()

inp = inp.split(" ")

#print(inp)

inp.sort()

#print(inp)
for stack in inp:
    print (stack.strip("\n"))

raw_input()
print " ".join(sorted(raw_input().split(' ')))

def gravity_flip(m):
    return sorted(m)
if __name__ == '__main__':
    n = int(input())
    a = list(map(str, input().split()))
    print(" ".join(gravity_flip(a)))

useless = input()
def newGravityOrder(order):
    order.sort()
    return order
for i in newGravityOrder(list(map(int,input().split(' ')))):
    print(i,end = '')

def Gravity():
	FirstInput = int(input())

	SecondInput = input()
	SecondInput=[int(s) for s in SecondInput.split(' ')]

	array=SecondInput
	Difference=0
	if FirstInput ==0:
		return 0
	elif FirstInput ==1:
		return SecondInput[0]
	else:

		for x in range(FirstInput-1):
			if(x==FirstInput-2):
				if(SecondInput[x]>SecondInput[x+1]):
					Difference=SecondInput[x]-SecondInput[x+1]
					SecondInput[x]=SecondInput[x]-Difference
					SecondInput[x+1]=SecondInput[x+1]+Difference

			elif(SecondInput[x]>SecondInput[x+1]):
				SecondInput[x]=SecondInput[x]-SecondInput[x+1]
				SecondInput[x+1]=SecondInput[x+1]+SecondInput[x]

	print (SecondInput)

Gravity()

n=int(input())
arr=list(map(int,input().split()))
arr.sort()
print(arr)

from sys import stdin

size = stdin.readline()
l = stdin.readline().split()

l.sort()

for i in l:
    print("your message")
    print(i, end = " ")

n=int(input())
s=[int(x) for x in input().split()]
s.sort()
s=[str(x) for x in s]
print("".join(s))

import sys

def gravityFlip(cols, ints):
	for idx in range(0, cols-1):
		desc = 1
		for col in range(0, cols-desc):
			if int(ints[col]) > int(ints[col+1]):
				temp = int(ints[col]) - int(ints[col-1])
				ints[col] = int(ints[col]) - temp
				ints[col-1] = int(ints[col-1]) + temp
			desc = desc+1
	for num in ints:
		print(int(num))

def main():
	cols = int(input())
	ints = input().split()
	return gravityFlip(cols, ints)

if __name__ == "__main__":
    main()

n = input()
a = input()
a = a.split(' ')
a.sort()
a = ' '.join(a)
print(a)
print(' ')

n=int(input())
k,s=input().split(),''
k.sort()
for i in k:
    s=s+i
print(s)

input()
i=list(map(int,input().split()))
i.sort()
print(j for j in i)

line=int(input())
numbers=list(input().split())
new_list=sorted(numbers)
if '100' in new_list:
    index1=new_list.index('100')
    new_list.pop(index1)
    new_list.append('100')
for number in new_list:
    print(number,end=' ')

n = input()
set = input()
res = []
if int(n)>0:
    set=list(set)
    for i in set:
        if i.isnumeric():
            res.append(i)
res.sort()
to_print=""

for j in res:
    to_print+=j+" "

print(to_print[0:-1])

def gravity_cube(input):
    size_col = 0
    square_counter = []
    for line in input:
        if line == "\n":
            continue
        else:
            if size_col == 0:
                size_col = int(line)
            else:
                for char in line:
                    if char == " ":
                        continue
                    else:
                        square_counter.append(int(char))

input()
x=list(raw_input().split())
print (' '.join(map(str,sorted(x))))

n=int(input())
s=[int(x) for x in input().split()]
s.sort()
s=[str(x) for x in s]
print(''.join(s))

n=int(input())
c=input().split()
c.sort()
print(" ".join(c))

input();l = list(input().split());sorted(l);print(' '.join(l))

import sys

if __name__ == "__main__":
    count = int(sys.stdin.readline().rstrip())
    heights = [int(i) for i in sys.stdin.readline().rstrip().split(' ')]
    for i in reversed(range(len(heights))):
        j = i
        print(j)
        while j < len(heights) - 1 and heights[j] > heights[j + 1]:
            diff = heights[j] - heights[j + 1]
            heights[j + 1] += diff
            heights[j] -= diff
            print(j, heights, diff)
            j += 1
    print(heights)

n = int(input())
A = list(map(int,input().split()))
print(sorted(A))

li=[]
n=input()
s=input()
li=s.split(" ")
li.sort()
print(li)

#parse and setup
numCol = input()
arr = []
#for i in range (0, numCol) :
    #add = input()
    #print (add)
    #arr.insert(add)

#debug
print (arr)

#begin gravity shift
#start from second to last
size = len(arr)
print (size)
if size == 1 :
    print (arr[0])
else :
    index = size - 2
    while index >= 0 :
        #if arr[index] > arr[index+1] :
            #diff = arr[index+1] - arr[index]
            #arr[index+1] += diff
            #arr[index] -= diff
        index-=1;

    #get return value
    ret = ""
    for i in arr:
        ret += i

    print (ret)

# Little Chris is bored during his physics lessons (too easy), so he has built a toy box to keep himself occupied. The box is special, since it has the ability to change gravity.

# There are n columns of toy cubes in the box arranged in a line. The i-th column contains a i cubes. At first, the gravity in the box is pulling the cubes downwards. When Chris switches the gravity, it begins to pull all the cubes to the right side of the box. The figure shows the initial and final configurations of the cubes in the box: the cubes that have changed their position are highlighted with orange.

# Given the initial configuration of the toy cubes in the box, find the amounts of cubes in each of the n columns after the gravity switch!

# Input
# The first line of input contains an integer n (1 ≤ n ≤ 100), the number of the columns in the box. The next line contains n space-separated integer numbers. The i-th number a i (1 ≤ a i ≤ 100) denotes the number of cubes in the i-th column.

# Output
# Output n integer numbers separated by spaces, where the i-th number is the amount of cubes in the i-th column after the gravity switch.

# Examples
# inputCopy
# 4
# 3 2 1 2
# outputCopy
# 1 2 2 3
# inputCopy
# 3
# 2 3 8
# outputCopy
# 2 3 8
# Note
# The first example case is shown on the figure. The top cube of the first column falls to the top of the last column; the top cube of the second column falls to the top of the third column; the middle cube of the first column falls to the top of the second column.

# In the second example case the gravity switch does not change the heights of the columns.

n = int(input())
cubes = list(map(str, input().split(' ')))
cubes.sort()
print(' '.join(cubes))

if __name__ == '__main__':
    n = int(input())
    cols = list(map(int, input().split()))

    res = 0
    old_cols = list()
    j = 0
    while(old_cols != cols):
        #print(old_cols, cols)
        old_cols = cols.copy()
        for i in range(len(cols) - 1):
            res = cols[i] - cols[i+1]
            if res > 0:
                cols[i+1] += res
                cols[i] -= res
        #print(old_cols, cols)
        j += 1
    #print(j)
    print(cols)

input()
lista = input().split(' ')

lista2 = list(lista)

lista2.sort()

string = ''
for i in lista2:
    string = string+i+' '

print(string)

n=int(input())
l=input().split()
l.sort()
print(*l)

input()
lista = input().split(' ')
lista.sort()
print(*lista)

#Gravity.py
#Granadino, Shara Mae I.

x = input()
y = raw_input().split()

ints = [int(l[0]) for l in y]

newlist =(sorted (y))

print ' '.join(newlist)

n = int(input())
m = sorted(input().split())
print(' '.join(m))

num_cols = int(raw_input())
cols = map(int, raw_input().split())

cols.sort()

print cols

n = raw_input()
b = sorted(raw_input().split())
print b

# GRAVITY.PY

columns = int(input())
numberPerColumn = raw_input().split()
numberPerColumn.sort()
retValString = ""

for y in range(0,columns):
    retValString += numberPerColumn[y] + " "

print retValString

input()
i=list(map(int,input().split()))
print(j for j in sorted(i))

n=int(input())
c=input().split()
c.sort()
print(" ".join(c))

nn=int(input())
arr=list(map(int,input().split()))
temp=sorted(arr)
i=0
while arr!=temp:
    arr[0]-=1
    arr[-i-1]+=1
    i+=1
print(arr)

n = input()
list = list(map(int,input().split(' ')))
list.sort()
print(list)

n=int(input())
strarr=str(input())
arr=strarr.split()
arr.sort()

print (arr)

n = input()
a = input()
a = a.split(' ')
a.sort()
a = ' '.join(a)
print(a)

coluna = int(raw_input())
cubosPorColuna = map(int,raw_input().split())
cubosPorColuna.sort()
print cubosPorColuna

n = int(input()) #количество столбцов
a = []
#for i in range(n):
a[:n-1] = input().split()
a.sort()
a = ' '.join(a)
print(a)

import sys
num_cols = sys.stdin.readline()
cols = sys.stdin.readline()
col_array = [int(i) for i in cols.split(" ")]
col_array.sort()
result = " ".join(cols)
print(result)

T = int(raw_input())
li = [raw_input().split()]
#li = [int(i) for i in li]
li.sort()
print li

input()
l=map(int,input().split())
m=str(sorted(l))
print(' '.join(m))

number_of_columns = int(input())
numbers = input().split(' ')

numbers = sorted(numbers)
print(' '.join(numbers).strip())

import sys

inp = sys.stdin.readline()
inp = sys.stdin.readline()

inp = inp.split(" ")

inp.sort();

print(inp)

n = int(input())

a = list(map(int,input().split()))

a.sort(reverse = True)

for i in a:

    print(i,end = ' ')

from sys import stdin

size = stdin.readline()
l = stdin.readline().split()

l.sort()

for i in l:
    print(i, end = " ")

line=int(input())
numbers=list(input().split())
new_list=sorted(numbers)
a=0
if '100' in new_list:
    while True:
        if '100' not in new_list:
            break
        else:
            index1=new_list.index('100')
            new_list.pop(index1)
            a+=1
for i in range(1,a+1):
    new_list.append('100')
for number in new_list:
    print(number,end=' ')

n = input()
col = [int(i) for i in raw_input().split()]
i = 0

print col
while(i < n-1):
	if(col[i] > col[i+1]):
		col[i+1] += (col[i+1] - col[i])
	i+=1

for i in col:
	print i,

n=int(input())
l=list(map(int,input().split()))
l=list(reversed(l))
a=''
for i in range(n-1):
	if l[i]<l[i+1]:
		c=l[i+1]-l[i]
		l[i]+=c
		l[i+1]-=c
l=list(reversed(l))
for i in range(n-1):
	a=a+str(l[i])+' '
a=a+str(l[n-1])
print(a)

_input = input('')

# _list = ' '.join(sorted(input(''))).strip()
_list = [x for x in input() if x.isdigit()]
_list.sort()
print(' '.join(_list))

#coding: utf-8

n = int(raw_input())

e = map(int, raw_input().split())
e.sort()

saida = ''
for i in e:
	saida += str(e) + " "
saida.strip()

print saida

n=input()
a=map(int,raw_input().split())
print a.sort()

colunas = int(raw_input())

linha = raw_input().split()

if len(linha) == colunas:
    linha.sort()

for i in range(len(linha)):
    print linha[i],

num = input()
list = input().replace(" ","")
list = sorted(list)
out = list[0]
for item in list[1:len(list)]:
    out += " "+item
print(out)

input()
i=list(map(int,input().split()))
print(j for j in sorted(i))

import sys

num_things = sys.stdin.readline()
line = sys.stdin.readline()

l = list()

nums = line.split(" ")
for n in nums:
    l.append(n)

l.sort()

for num in l:
    print(num, end = " ")

# import sys

# import numpy as np

# def line_generator():
#     for line in sys.stdin:
#         yield line

# line = line_generator()

if __name__ == '__main__':
    pass
    # Read lines
    # n = next(line)
    # col_heights = next(line)

    # # Convert to ints
    # n = int(n.strip())
    # col_heights = [int(col_str) for col_str in col_heights.split()]

    # # Transform Input
    # box = np.zeros([max(col_heights), n])
    # for c, col_height in enumerate(col_heights):
    #     box[-col_height:, c] = 1

    # # Tip Sideways
    # for i, row in enumerate(box):
    #     num_zeros = np.sum(row == 0)
    #     box[i, :num_zeros], box[i, num_zeros:] = 0, 1

    # # Count Number of Columns
    # new_col_heights = box.sum(axis=0, dtype=np.int)

    # print(' '.join(str(new_col_height) for new_col_height in new_col_heights))

n = input()
x=map(int,raw_input().split())
print x.sort()

import sys
the_list = sys.stdin.readlines()
the_list[1].rstrip()
#slist = [int(x) for x in the_list[1].split()]
#slist.sort()
#for x in slist:
    #print(x + ' ')
print("yeppers")

input()
x=input()
o=""
for i in sorted(x):
    o=o+i+" "
print(o)

from sys import stdin,stdout
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))
n=int(input())

for i in range(n):
    lis=list(map(int, input().split()))
    a=lis.sort()
print(a)

n = int(input())
list = input().split(" ")

list.sort()
x = "";

for a in list:
    x += a + " "

print(x)

input()
def sort_column(cube):
	for column in range(1, len(cube)):
		hole = column
		while hole > 0 and cube[hole] < cube[hole - 1]:
			cube[hole], cube[hole - 1] = cube[hole - 1], cube[hole]
	return cube
sorted_cube = sort_column(list(map(int,input().split())))
for column in sorted_cube:
    print(column, end=" ")

n = input()
a = list(map(int, input().split()))
a.sort()
print(a)

def merge(arr1, arr2):
	l1, l2 = len(arr1), len(arr2)
	i, j, k = 0, 0, 0
	while i < l1 or j < l2:
		if i < l1 and j < l2:
			if arr1[i] < arr2[j]:
				yield arr1[i]
				i += 1
			else:
				yield arr2[j]
				j += 1
		elif i < l1 and j >= l2:
			yield arr1[i]
			i += 1
		else:
			yield arr2[j]
			j += 1
		k += 1
	return

def sort_cube(arr):
	if len(arr) < 2:
		return arr
	return list(merge(sort_cube(arr[0:len(arr)//2]), sort_cube(arr[len(arr)//2:])))
cube = sort_cube([1,2,3,41,12,12,0,-1])
for column in cube:
	print(column, end = " ")

from sys import stdin

size = stdin.readline()
l = stdin.readline().split()

l.sort()

for i in l:
    print(i, end = " ")

from sys import stdin, stdout

q = int(stdin.readline().rstrip())
numeros = stdin.readline().rstrip()
numeros = numeros.split(' ')
numeros.sort()

for numero in numeros:
    stdout.write(numero + ' ')

input()
x=input().split()
o=""
for i in sorted(x):
    o=o+i+" "
print(o)

n = int(input())
print(sorted(list(map(int, input().split()))))

inp=int(raw_input())
inp2=raw_input().split()
ans=' '.join(sorted(inp2))
print ans
'''for i in ans:
	i=i.split(" ")
	s.append(i)
#org=' '.join(ans)
print s'''

columns = input()
listOfInputs = input().split()
l = sorted(listOfInputs)
for n in range(len(l)):
    print(l[n], end = " ")

import sys

if __name__ == "__main__":
    count = int(sys.stdin.readline().rstrip())
    heights = [int(i) for i in sys.stdin.readline().rstrip().split(' ')]
    for i in reversed(range(len(heights))):
        j = i
        print(j)
        while j < len(heights) - 1 and heights[j] > heights[j + 1]:
            diff = heights[j + 1] - heights[j]
            heights[j + 1] += diff
            heights[j] -= diff
            j += 1
            print(j, heights, diff)
    print(heights)

numbers = raw_input().split()
numbers.sort()
s = ""
for i in numbers:
	s = s + i + " "

print s

n=int(input())
strarr=str(input())
arr=strarr.split()
arr.sort()

print (arr)

n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
print("".join(str(x) for x in l))

num = int(raw_input())

c = 1

nums = raw_input().split(" ")
nums.sort()
s = nums[0]
if len(nums)<=1:
	s = nums[0]
while(c != len(nums)):
	s += " " + nums[c]
	c +=1
print s

def gravity_flip(arr):
    return sorted(arr)

if __name__ == '__main__':
    print('hello')
    # cnt = int(input())
    # arr = []
    # for i in range(cnt):
    #     arr.append(int(input()))
    # # arr = list(map(int, input().rstrip().split()))
    # res = gravity_flip(arr)

input()
print ' '.join(sorted(raw_input().split()))

num_of_cols = int(input())
x = raw_input().split()
list1 = []
i = 0

while i < num_of_cols:
    num_of_blocks = x[i]
    list1.append(num_of_blocks)
    i = i + 1

list1.sort()
print ' '.join(list1)

n=int(input())
c=input().split()
c.sort()
print(" ".join(c))

#Gravity.py
#Granadino, Shara Mae I.

x = input()
list = raw_input().split()

newlist= (sorted (list))

print ' ' .join(newlist)

n=int(input())
k,s=input().split(),''
k.sort()
for i in k:
    s=s+i
print(s)

#!/usr/bin/env Python3
n=int(input())
m=input()

cubes=m.split()
cubes.sort()

print (' '.join(cubes))

n = int(input())
lis1 = list(map(int , input().split()))
while not lis1 == sorted(lis1):
    for i in range(n-1):
        if lis1[i] > lis1[i+1]:
            lis1[i] -=1
            lis1[i+1] +=1
print(*lis1 , sep=' ')


Sometimes one has to spell email addresses over the phone. Then one usually pronounces a dot as dot, an at sign as at. As a result, we get something like vasyaatgmaildotcom. Your task is to transform it into a proper email address (vasya@gmail.com). It is known that a proper email address contains only such symbols as . @ and lower-case Latin letters, doesn't start with and doesn't end with a dot. Also, a proper email address doesn't start with and doesn't end with an at sign. Moreover, an email address contains exactly one such symbol as @, yet may contain any number (possible, zero) of dots. You have to carry out a series of replacements so that the length of the result was as short as possible and it was a proper email address. If the lengths are equal, you should print the lexicographically minimal result. Overall, two variants of replacement are possible: dot can be replaced by a dot, at can be replaced by an at.

The first line contains the email address description. It is guaranteed that that is a proper email address with all the dots replaced by dot an the at signs replaced by at. The line is not empty and its length does not exceed 100 symbols.

Print the shortest email address, from which the given line could be made by the described above replacements. If there are several solutions to that problem, print the lexicographically minimal one (the lexicographical comparison of the lines are implemented with an operator < in modern programming languages). In the ASCII table the symbols go in this order: . @ ab...z

st = raw_input()
rep = st[1:-1:].replace("at", "@", 1)
rep = rep.replace("dot", ".")
print st[0] + rep + st[-1]

I=lambda:map(int, raw_input().split())
s = raw_input()
if (len(s)) == 0: print '';exit()
ans = s[0]
flag = False
i, n = 1, len(s)
while i < n:
    if i+1 < n-1 and i+2 < n-1 and s[i] == 'd' and s[i+1] == 'o' and s[i+2] == 't':
        ans += '.'; i += 3
    elif i+1 < n and s[i] == 'a' and s[i+1] == 't' and not flag:
        ans += '@'; i += 2; flag=True
    else:
        ans += s[i]; i += 1
print ans

#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    s = raw_input()
    s = s[0] + s[1:-1].replace("dot", ".") + s[-1]
    s = s[:s[1:].find("at") + 1] + "@" + s[s[1:].find("at") + 3:]
    print s
    return 0

if __name__ == '__main__':
    main()

inp = [i for i in raw_input()]
n = len(inp)
a = True
i = 1
while(i <n-2):
    if(i!=n-3 and inp[i]=='d' and inp[i+1]=='o' and inp[i+2]=='t'):
        inp = inp[:i]+['.']+inp[i+3:]
        n-=2
    elif(inp[i]=='a' and inp[i+1]=='t'):
        if(a==True):
            inp = inp[:i]+['@']+inp[i+2:]
            a = False
            n-=1
    i+=1
print "".join(inp)

buf = raw_input()

buf = buf[0] + buf[1:-1].replace('dot','.') + buf[-1]
buf = buf[0] + buf[1:].replace('at','@',1)

print buf

import sys

file = sys.stdin
#file = open("test", "r")
line = file.readline().rstrip()
ori = line
line = ori[0] + line[1: len(line) - 1].replace("at", "@", 1)+ ori[-1]
line = ori[0] + line[1: len(line) - 1].replace("dot", ".")+ ori[-1]
print line

# http://codeforces.com/problemset/status/41/problem/C

# main

s = raw_input();
t = s[1:-1].replace("dot", ".").replace("at", "@", 1);
print s[0] + t + s[-1]

rs = raw_input()
s = rs[1:-1]
l = len(s)
res = rs[0]
i = 0
findAt = False
while(i < l):
	if(i + 3 <= l):
		if(s[i:i+3] == "dot"):
			res += "."
			i += 3
			continue
	if(i + 2 <= l and (not findAt)):
		if(s[i:i+2] == "at"):
			res += "@"
			findAt = True
			i += 2
			continue
	res += s[i]
	i += 1
res += rs[-1]
print res

#code:utf-8
s = raw_input()
res = ""
at = False
i = 0
while i<len(s):
    if i!=0 and i+3<len(s) and s[i:i+3]=="dot":
        res += '.'
        i += 2
    elif i!=0 and i+2<len(s) and at == False and s[i:i+2]=="at":
        res += '@'
        at = True
        i += 1
    else:
        res += s[i]
    i += 1
print res

import sys
import string

#sys.stdin = open("41.in","r")

a = raw_input()
h = a[0]
a = a[1:]
i = a.find("at")
wei = a[i+2:]
a = a[:i+2]

#print h,a,wei

a = a.replace("dot", ".")
w = wei[:len(wei)-1].replace("dot", ".")
a = a.replace("at", "@")

print h+a+w+wei[len(wei)-1]

#! /usr/bin/env python

import sys

instr = raw_input()
first = instr[0]
last = instr[-1]
instr = instr[1:-1]
instr = instr.replace('at', '@', 1)
instr = instr.replace('dot', '.')
instr = first + instr + last
print instr

#! /usr/bin/env python

import sys

instr = raw_input()
print instr[0] + instr[1:-1].replace('at', '@', 1).replace('dot', '.') + instr[-1]

s=raw_input()
e=[]
at=True
for i in range(0,len(s)):
    x=s[i]
    if s[i-2:i+1]=='dot' and i!=len(s)-1 and i!=2:
        e.pop()
        e.pop()
        e.append('.')
    elif s[i-1:i+1]=='at' and at and i!=1 and i!=len(s)-1:
        e.pop()
        e.append('@')
        at=False
    else:
        e.append(x)
z=''
for i in range(0,len(e)):
    z=z+e[i]
print z

from math import *
from Queue import *
from sys import *
from random import *

s = raw_input()
n = len(s)
i = 1
red = s[0]
while i < n-3:
    if s[i] == 'd' and s[i+1] == 'o' and s[i+2] == 't':
        red += '.'
        i += 3
    else:
        red += s[i]
        i += 1
red += s[i:]
cand = []
for i in range(1, len(red)-2):
    if red[i] == 'a' and red[i+1] == 't':
        cand.append(red[:i] + '@' + red[i+2:])
cand.sort()
print(cand[0])

s = input()
l = [i for i in s]
l.append('.')
l.append('.')
l.append('.')
n = len(s)
p = []
p.append(s[0])
i = 1
f=0
while i<n:
    if s[i]=='d' and s[i+1]=='o' and s[i+2]=='t':
        p.append('.')
        i+=2
    elif f==0 and s[i]=='a' and s[i+1]=='t':
        p.append('@')
        f=1
        i+=1
    else:
        p.append(s[i])
    i+=1
#print(p)
if p[-1]=='.':
    p.pop()
    p.append('d')
    p.append('o')
    p.append('t')
print(''.join(p))

t = input()
t = t.replace("dot", '.')
t = t.replace("at", '@')
if t.find('.')==0: t = t.replace(".", "dot", 1)
if t.find('@')==0: t = t.replace("@", "at", 1)
if t.rfind('.')==len(t)-1:
    t = t[0:len(t)-1]
    t += "dot"
if t.rfind('@')==len(t)-1:
    t = t[0:len(t)-1]
    t += "at"
fir = t.find('@')
pref = t[0:fir+1]
suf = t[fir+1:]
suf = suf.replace('@', "at")
print(pref+suf)

str=input()
newStr=str[0]+str[1:].replace('at','@',1)
str=newStr[0]+newStr[1:-1].replace('dot','.')+newStr[-1]

print(str)

s=input()
at=s.find('at',1)
s=s[:at]+'@'+s[at+2:]
pos=1
while 1:
	ns=''
	dot=s.find('dot',pos,-1)
	if dot==-1:
		break
	ns+=s[:dot]
	ns+='.'
	pos=dot+1
	ns+=s[dot+3:]
	s=ns
print(s)

string = input()
while "dot" in string[1:-1]:
	string = string[:string[1:].index("dot")+1]+"."+string[string[1:].index("dot")+4:]
string = string[:string[1:].index("at")+1]+"@"+string[string[1:].index("at")+3:]
print(string)

def is_dot(s, i):
    if i != 0 and i + 3 < len(s) and s[i] == 'd' and s[i + 1] == 'o' and s[i + 2] == 't':
        return True
    return False

def is_at(t, j):
    if j != 0 and j + 2 < len(t) and t[j] == 'a' and t[j + 1] == 't':
        return True
    return False

def email(s):
    m = ''
    i = 0
    flag = 0
    while i < len(s):
        if is_dot(s, i):
            m += "."
            i += 3
        else:
            if is_at(s, i) and flag == 0:
                m += "@"
                flag = 1
                i += 2
            else:
                m += s[i]
                i += 1
    return m

print(email(input()))

 # ///==========Libraries, Constants and Functions=============///
#mkraghav
import sys

inf = float("inf")
mod = 1000000007

def get_array(): return list(map(int, sys.stdin.readline().split()))

def get_ints(): return map(int, sys.stdin.readline().split())

def input(): return sys.stdin.readline()

def int1():return int(input())

import string

import math

from itertools import combinations
# ///==========MAIN=============///

def main():

    l=(input())
    j2=len(l)

    s=list(l)
    s.pop()
    j=l[len(l)-4:len(l)-1]

    j3=l.index('at')

    if j3==0:

        q4=l[:j3+2]
        q5=l[j3+2:]
        q5=q5.replace('at','@',1)
        l=q4+q5
    else:
        l=l.replace('at','@',1)

    if 'dot' in l:
        i=(l.index('dot'))
    else:
        i=100000

    if (l.count('dot'))>=1 and i!=0:
        l=l.replace('dot','.')

    elif i==0 :
        l4=l[:i+3]
        l5=l[i+3:]
        l5=l5.replace('dot','.')
        l=l4+l5

    if j=='dot':

        l=l[:len(l)-2]+'dot'
    print(l)

if __name__ == "__main__":
    main()

from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest

def binNumber(n,size):
    return bin(n)[2:].zfill(size)

def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)

def iar():
    return list(map(int,input().split()))

def ini():
    return int(input())

def isp():
    return map(int,input().split())

def sti():
    return str(input())

#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|
#  code
if __name__ == "__main__":
    s = sti()
    m = s[0]
    i = 1
    at = 0
    while i < len(s):
        if i+3 < len(s) and s[i:i+3] == "dot":
            m += "."
            i += 3
        elif i+2 < len(s) and s[i:i+2] == "at" and at == 0:
            m += "@"
            i += 2
            at = 1
        else:
            m += s[i]
            i += 1
    print(m)

s = input()
res_s = ""
if s[0:2] == "at":
    s = s[2:]
    res_s += "at"
elif s[0:3] == "dot":
    s = s[3:]
    res_s += "dot"
i = 0
n = len(s)
flag = False
while i != len(s):
    done = False
    try:
        if s[i:i + 2] == "at" and i != n - 2 and not flag:
            i += 2
            res_s += "@"
            flag = True
            done = True
        elif s[i:i + 3] == "dot" and i != n - 3:
            i += 3
            res_s += "."
            done = True
    except:
        pass
    if done:
        continue
    res_s += s[i]
    i += 1
print(res_s)

s = input()
email = s[0]
pointer = 1
at_not_used = True
while pointer < len(s):
    if s[pointer] == 'd' and pointer < len(s) - 3 and s[pointer:pointer + 3] == 'dot':
        email += '.'
        pointer += 3
    elif s[pointer] == 'a' and pointer < len(s) - 1 and s[pointer:pointer + 2] == 'at' and at_not_used:
        email += '@'
        at_not_used = False
        pointer += 2
    else:
        email += s[pointer]
        pointer += 1
print(email)

s=input()

t=s[0]+s[1:].replace('at','@',1)

s=t[0]+t[1:-1].replace('dot','.')+t[-1]

print(s)

# Made By Mostafa_Khaled

s=input()
s1=s[0]
sm=s[len(s)-1]
s=s1+s[1:len(s)-1].replace('dot','.')+sm
for i in range(1,len(s)-1):
    if s[i]=='a' and s[i+1]=='t':
        s=s[:i]+'@'+s[i+2:]
        break
print(s)

import sys
import math
import string
import operator
import functools
import fractions
import collections
sys.setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda: list(map(int,input().split()))
RS=lambda: input().rstrip().split()
#################################################
MAX=1001
s=input().rstrip()
s=s[0]+s[1:-1].replace('dot','.')+s[-1]
s=s[0]+s[1:-1].replace('at','@',1)+s[-1]
print(s)

a=str(raw_input())

head=''
if a.startswith('dot'):
	head='dot'
	a=a[3:]
elif a.startswith('at'):
	head='at'
	a=a[2:]

tail=''
if a.endswith('dot'):
	tail='dot'
	a=a[:len(a)-3]
elif a.endswith('at'):
	tail='at'
	a=a[:len(a)-2]
print head + a.replace("dot", ".").replace("at", "@", 1) + tail

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

s = raw_input ()
s = s.replace ("dot", ".")
if s [0] == '.': s = "dot" + s [1:]
if s [-1] == '.': s = s [:-1] + "dot"
idx = s [1:].find ("at")
s = s [:idx + 1] + "@" + s [idx + 3:]
print s

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

s = raw_input ()
t = s [1:-1].replace ("at", "@", 1).replace ("dot", ".")
print s [0] + t + s [-1]

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
co = 0
c = []
l = 0
if a[0] == '@':
 a = 'at' + a[1:]
for i in a:
 if i=='@':
  if co > 0:
   c.append('at')
   co = 1
  else:
   c.append('@')
   co = 1
 else:
  c.append(i)
c=  ''.join(c)
if c[-1]=='.':
 c = c[:-1] + 'dot'
print c

s = raw_input()
l = len(s)
ans = [s[0]]
i = 1
atdone = False
while i < l:
    if i < l-3 and s[i:i+3] == "dot":
        ans.append(".")
        i += 3
    elif not atdone and s[i:i+2] == "at":
        ans.append("@")
        i += 2
        atdone = True
    else:
        ans.append(s[i])
        i += 1
print ''.join(ans)

import sys
import re

r = re.compile('at')

input = sys.stdin

pre = ''
body = input.readline().strip()
suf = ''

if body.startswith('dot'):
  pre = 'dot'
  body = body[3:]
elif body.startswith('at'):
  pre = 'at'
  body = body[2:]

if body.endswith('dot'):
  suf = 'dot'
  body = body[:len(body)-3]
elif body.endswith('at'):
  suf = 'at'
  body = body[:len(body)-2]

print pre + r.sub('@', body.replace('dot','.'), 1) + suf

a = str(raw_input())

head = ""
if a.startswith("dot"):
    head = "dot"
    a = a[3:]
elif a.startswith("at"):
    head = "at"
    a = a[2:]

tail = ""
if a.endswith("dot"):
    tail = "dot"
    a = a[:len(a)-3]
elif a.endswith("at"):
    tail = "at"
    a = a[:len(a)-2]

print head + a.replace("dot", ".").replace("at", "@", 1) + tail

r=raw_input()
if len(r)==1:print r;exit()
s,f=r[0],r[-1]
r=r[1:-1]
if '@' not in r: r=r.replace('at','@',1)
r=r.replace('dot','.')
print s+r+f

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
n=raw_input()
kari=n
#print n[1:-1]
n=n[1:-1].replace('dot','.')
#n=n[::-1]
n=n.replace('at','@',1)
#n=n[::-1]
print kari[0]+n+kari[-1]

s = raw_input()
if(s.find("at")<>0):
    s = s.replace("at","@",1)
else:
    s = s.replace("at","@",2)
    s = s.replace("@","at",1)

dotpos=-1
if(s.find("dot")==0):
    dotpos=4
elif(s.find("dot")==-1):
    dotpos=0

while(dotpos<>0):
    if(s.find("dot",dotpos)<>0 and s.find("dot",dotpos)<>len(s)-3):
        s = s.replace("dot",".",dotpos)
    dotpos = s.find("dot",dotpos)+1

if(s[0]=="."):
    s=s[1:]
    s="dot"+s
if(s[len(s)-1]=='.'):
    s=s[:len(s)-1]
    s+="dot"
if(s[0]=="@"):
    s=s[1:]
    s="at"+s
if(s[len(s)-1]=='@'):
    s=s[:len(s)-1]
    s+="at"

print s

s=raw_input()
st,s,ed=s[0],s[1:-1],s[-1]
a=''
at=False
i=0
while i<len(s):
	if not at and s[i:i+2]=='at':
		a+='@'
		at=True
		i+=2
	elif s[i:i+3]=='dot':
		a+='.'
		i+=3
	else:
		a+=s[i]
		i+=1
print st+a+ed

from sys import stdin
#x = [ 'dotdotdotatatatatdotdotat' ]

x = stdin.readlines()
s = map( lambda x: x. strip(), [ l for l in x ] )[0]

f = s[0]
l = s[-1]
s = s[1:-1]
s = s.replace( 'dot', '.' )
s = s.replace( 'at', '@', 1 )

print f + s + l

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8

r=raw_input()
s = r[1:]
s = s[:-1]
s=s.replace('at','@',1)
s=s.replace('dot','.')
s = r[0] + s + r[-1]
print s

d = {'at':'@',
     'dot':'.'}
s = raw_input()
n = len(s)
i = 0
ss = ""
ct = 0
while i<n:
    s1 = s[i:i+2]
    s2 = s[i:i+3]
    if s1 in d and not(i==0) and not(i==(n-2)) and ct==0:
        ss+=d[s1]
        ct += 1
        i += 1
    elif s2 in d and not(i==0) and not(i==(n-2)) and not(i==(n-3)):
        ss+=d[s2]
        i+=2
    else:
        ss+=s[i]
    i+=1
print ss

# -*- coding: UTF-8 -*-

# from itertools import *
# from collections import defaultdict
T = raw_input().replace("dot", ".")
if T[0] == ".":
    T = "dot" + T[1:]
if T[-1] == ".":
    T = T[:-1]+"dot"
at_index = T.index("at", 1)
T = T[:at_index] + "@" + T[at_index+2:]
print T

s = input()
c1 = s[0]
c2 = s[-1]

s = s[1:-1]

s = s.replace("dot", ".")
s = s.replace("at", "@", 1)

print(c1 + s + c2)

# Your last C/C++ code is saved below:
# #include <iostream>
# using namespace std;

# #define ll long long
# #define fi first
# #define se second

# typedef vector <>
# typedef vector <ii> vii

# int main() {
# 	int n, k;
#     cin >> n >> k;

# }

import sys
from array import array  # noqa: F401

def input():
    return sys.stdin.buffer.readline().decode('utf-8')

s = input().rstrip()
ans = s[0]
suf = s[-1]
s = s[1:-1]
at_flag = 0

while s:
    if s[:3] == 'dot':
        ans += '.'
        s = s[3:]
    elif not at_flag and s[:2] == 'at':
        ans += '@'
        at_flag = 1
        s = s[2:]
    else:
        ans += s[0]
        s = s[1:]

print(ans + suf)

def main():
    desc = input()
    chunk = desc[1:-1]
    chunk = chunk.replace("at", "@", 1)
    chunk = chunk.replace("dot", ".")
    print(desc[0] + chunk + desc[-1])
main()

from collections import *
from math import *
from sys import *
s = input()
l = [s[0]]
n = len(s)
i = 1
flag = 0
while(i<n):
    if(i < n-3 and s[i:i+3] == "dot"):
        l.append(".")
        i += 3
    elif(flag == 0 and i < n-2 and s[i:i+2] == "at"):
        l.append("@")
        i += 2
        flag = 1
    else:
        l.append(s[i])
        i += 1
print("".join(l))

#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
#from fractions import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
#vsInput()

s=input()
at=1+s[1:].index('at')
s=list(s)
s[at:at+2]=['@']
#print(s)

n=len(s)
for i in range(1,n):
    #print(s[i:i+3])
    if(s[i:i+3]==['d','o','t']):
        #print()
        if(i!=len(s)-3):
            s[i:i+3]=['.']
print(*s,sep="")

import re

email = input()

first = re.sub(r'(?<!^)at(?!$)', r'@', email, count=1)

second = re.sub(r'(?<!^)dot(?!$)', r'.', first)

print(second)

from sys import stdin, stdout

s = list(stdin.readline().strip())

i = 1
while i < len(s) - 3:
    if ''.join(s[i:i + 3]) == 'dot':
        s = s[:i] + ['.'] + s[i + 3:]
    i += 1

i = 1
while i < len(s) - 2:
    if ''.join(s[i:i + 2]) == 'at':
        s = s[:i] + ['@'] + s[i + 2:]
        break
    i += 1

stdout.write(''.join(s))

"""
Author    : co_devil Chirag Garg
Institute : JIIT
"""
from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
# from bisect import bisect_left,bisect_right
# from decimal import *,threading
from fractions import Fraction

"""from io import BytesIO, IOBase
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__
    str = lambda x=b'': x if type(x) is bytes else __str__(x).encode()
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = 'x' in file.mode or 'r' not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        return self._buffer.read() if self._buffer.tell() else os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b, ptr = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE)), self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
            self.newlines += b.count(b'\n') + (not b)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)
sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b'\r\n')

def print(*args, **kwargs):
    sep, file = kwargs.pop('sep', b' '), kwargs.pop('file', sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop('end', b'\n'))
    if kwargs.pop('flush', False):
        file.flush()

"""

def ii(): return int(input())

def si(): return str(input())

def mi(): return map(int, input().split())

def li(): return list(mi())

def fii(): return int(stdin.readline())

def fsi(): return str(stdin.readline())

def fmi(): return map(int, stdin.readline().split())

def fli(): return list(fmi())

abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}
mod = 1000000007
dx, dy = [-1, 1, 0, 0], [0, 0, 1, -1]

def getKey(item): return item[0]

def sort2(l): return sorted(l, key=getKey)

def d2(n, m, num): return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x): return (x and (not (x & (x - 1))))

def decimalToBinary(n): return bin(n).replace("0b", "")

def ntl(n): return [int(i) for i in str(n)]

def powerMod(x, y, p):
    res = 1
    x %= p
    while y > 0:
        if y & 1:
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

# For getting input from input.txt file
# sys.stdin = open('input.txt', 'r')

# Printing the Output to output.txt file
# sys.stdout = open('output.txt', 'w')

graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
    if visited[v]:
        if col[v] != c:
            print('-1')
            exit()
        return
    col[v] = c
    visited[v] = 1
    for i in graph[v]:
        dfs(i, c ^ 1)

def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)

def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d.keys():
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d.keys():
            d[y] = [x]
        else:
            d[y].append(x)
    return d

def gr2(n):
    d = {}
    for i in range(n):
        x, y = mi()
        if x not in d.keys():
            d[x] = [y]
        else:
            d[x].append(y)
    return d

def connected_components(graph):
    seen = set()

    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component

    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans

def primeFactors(n):
    s = set()
    while n % 2 == 0:
        s.add(2)
        n = n // 2
    for i in range(3, int(sqrt(n)) + 1, 2):
        while n % i == 0:
            s.add(i)
            n = n // i
    if n > 2:
        s.add(n)
    return s

def find_all(a_str, sub):
    start = 0
    while True:
        start = a_str.find(sub, start)
        if start == -1: return
        yield start
        start += len(sub)

s=si()
m = s[0]
i = 1
at = 0
while i < len(s):
    if i+3 < len(s) and s[i:i+3] == "dot":
        m += "."
        i += 3
    elif i+2 < len(s) and s[i:i+2] == "at" and at == 0:
        m += "@"
        i += 2
        at = 1
    else:
        m += s[i]
        i += 1
print(m)

s=raw_input()

s=s[0]+s[1:].replace("dot",".")
s=s.replace("at","@",1)
print s;

I=lambda:map(int, raw_input().split())
s = raw_input()
if (len(s)) == 0: print '';exit()
ans = s[0]
flag = False
i, n = 1, len(s)
while i < n:
    if i+1 < n and i+2 < n and s[i] == 'd' and s[i+1] == 'o' and s[i+2] == 't':
        ans += '.'; i += 3
    elif i+1 < n and s[i] == 'a' and s[i+1] == 't' and not flag:
        ans += '@'; i += 2; flag=True
    else:
        ans += s[i]; i += 1
print ans

#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    s = raw_input()
    s = s[0] + s[1:-1].replace("dot", ".") + s[-1]
    s = s[:s[1:].find("at")] + "@" + s[s[1:].find("at") + 2:]
    print s
    return 0

if __name__ == '__main__':
    main()

#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    s = raw_input()
    s = s[0] + s[1:-1].replace("dot", ".") + s[-1]
    s = s[:s.rfind("at")] + "@" + s[s.rfind("at") + 2:]
    print s
    return 0

if __name__ == '__main__':
    main()

#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    s = raw_input()
    s = s[0] + s[1:-1].replace("dot", ".") + s[-1]
    s = s[:s.find("at")] + "@" + s[s.find("at") + 2:]
    print s
    return 0

if __name__ == '__main__':
    main()

rs = raw_input()
s = rs[1:-1]
l = len(s)
res = rs[0]
i = 0
findAt = False
while(i < l):
	if(i + 3 <= l):
		if(s[i:i+3] == "dot"):
			res += "."
			i += 3
			continue
	if(i + 2 <= l and (not findAt)):
		if(s[i:i+2] == "at"):
			res += "@"
			i += 2
			continue
	res += s[i]
	i += 1
res += rs[-1]
print res

import sys
import string

#sys.stdin = open("41.in","r")

a = raw_input()
h = a[0]
a = a[1:]
i = a.find("at")
wei = a[i+2:]
a = a[:i+2]

#print h,a,wei

a = a.replace("dot", ".")
wei = wei.replace("dot", ".")
a = a.replace("at", "@")

print h+a+wei

# -*- coding: utf-8 -*-
from __future__ import print_function

s=raw_input('введи ящик\n')
e=[]
at=True
for i in range(0,len(s)):
    x=s[i]
    if s[i-1]==s[i] and i!=len(s)-1:
      pass
    elif s[i-2:i+1]=='dot' and i!=len(s)-1 and i!=2:
        e.pop()
        e.pop()
        e.append('.')
    elif s[i-1:i+1]=='at' and at:
        if s[i-1]!=s[i-2]:
            e.pop()
        e.append('@')
        at=False
    else:
        e.append(x)
for i in range(0,len(e)):
    print(e[i],end='')

# -*- coding: utf-8 -*-
s=raw_input()
e=[]
at=True
for i in range(0,len(s)):
    x=s[i]
    if s[i-1]==s[i] and i!=len(s)-1:
      pass
    elif s[i-2:i+1]=='dot' and i!=len(s)-1 and i!=2:
        e.pop()
        e.pop()
        e.append('.')
    elif s[i-1:i+1]=='at' and at:
        if s[i-1]!=s[i-2]:
            e.pop()
        e.append('@')
        at=False
    else:
        e.append(x)
z=''
for i in range(0,len(e)):
    z=z+e[i]
print z

# -*- coding: utf-8 -*-
s=raw_input()
e=[]
at=True
for i in range(0,len(s)):
    x=s[i]
    if s[i-2:i+1]=='dot' and i!=len(s)-1 and i!=2:
        e.pop()
        e.pop()
        e.append('.')
    elif s[i-1:i+1]=='at' and at:
        e.pop()
        e.append('@')
        at=False
    else:
        e.append(x)
z=''
for i in range(0,len(e)):
    z=z+e[i]
print z

# -*- coding: utf-8 -*-

s=raw_input('TAKE yashik\n')
e=[]
at=True
for i in range(0,len(s)):
    x=s[i]
    if s[i-1]==s[i] and i!=len(s)-1:
      pass
    elif s[i-2:i+1]=='dot' and i!=len(s)-1 and i!=2:
        e.pop()
        e.pop()
        e.append('.')
    elif s[i-1:i+1]=='at' and at:
        if s[i-1]!=s[i-2]:
            e.pop()
        e.append('@')
        at=False
    else:
        e.append(x)
z=''
for i in range(0,len(e)):
    z=z+e[i]
print z

from math import *
from Queue import *
from sys import *
from random import *

s = raw_input()
for i in range(1,len(s)-3):
    if s[i:i+3] == 'dot':
        s = s[:i] + '.' + s[i+3:]
cand = []
for i in range(1,len(s)-2):
    if s[i:i+2] == 'at':
        cand.append(s[:i] + '@' + s[i+2:])
cand.sort()
print(cand[0])

from math import *
from Queue import *
from sys import *
from random import *

s = raw_input()
for i in range(1,len(s)-3):
    if s[i:i+3] == 'dot':
        s = s[:i] + '.' + s[i+3:]
for i in range(1,len(s)-1):
    if s[i:i+2] == 'at':
        s = s[:i] + '@' + s[i+2:]
        break
print(s)

from math import *
from Queue import *
from sys import *
from random import *

s = raw_input()
for i in range(1,len(s)-3):
    if s[i:i+3] == 'dot':
        s = s[:i] + '.' + s[i+3:]
cand = []
for i in range(1,len(s)-1):
    if s[i:i+2] == 'at':
        cand.append(s[:i] + '@' + s[i+2:])
cand.sort()
print(cand[0])

s = input()
l = [i for i in s]
l.append('.')
l.append('.')
l.append('.')
n = len(s)
p = []
p.append(s[0])
i = 1
while i<n:
    if s[i]=='d' and s[i+1]=='o' and s[i+2]=='t':
        p.append('.')
        i+=2
    elif s[i]=='a' and s[i+1]=='t':
        p.append('@')
        i+=1
    else:
        p.append(s[i])
    i+=1
#print(p)
if p[-1]=='@':
    p.pop()
    p.append('a')
    p.append('t')
#print(p)
k=100
j=0
while j<len(p):
    if p[j]=='@':
        if k<j:
            p.pop(k)
            p.insert(k,'t')
            p.insert(k,'a')
            j+=1
        k = j
    j+=1

print(''.join(p))

t = input()
t = t.replace("dot", '.')
t = t.replace("at", '@')
if t.find('.')==0: t = t.replace(".", "dot", 1)
if t.find('@')==0: t = t.replace("@", "at", 1)
if t.rfind('.')==len(t)-1:
    t = t[0:len(t)-2]
    t += "dot"
if t.rfind('@')==len(t)-1:
    t = t[0:len(t)-1]
    t += "at"
fir = t.find('@')
pref = t[0:fir+1]
suf = t[fir+1:]
suf = suf.replace('@', "at")
print(pref+suf)

a=input()
b=''
c=False
while a:
    if a[:3]=='dot':
        b+='.'
        a=a[3:]
    elif a[:2]=='at' and not c:
        b+='@'
        c=True
        a=a[2:]
    else:
        b+=a[0]
        a=a[1:]
if b[0]=='.':print('dot'+b[1:])
else:print(b)

s = input()

n = len(s)

dot_entry = [s.find('dot', i) for i in range(n)]
dot_entry = list(set(dot_entry))[:-1]

if dot_entry:
    s = s.replace('dot', '.')
    if s[0] == '.':
        s = s.replace('.', 'dot', 1)
    if s[-1] == '.':
        s = s[:n-1] + 'dot'

s = s.replace('at', '@', 1)

print(s)

def is_dot(s, i):
    if i != 0 and i + 2 < len(s) and s[i] == 'd' and s[i + 1] == 'o' and s[i + 2] == 't':
        return True
    return False

def is_at(t, j):
    if j != 0 and j + 2 < len(t) and t[j] == 'a' and t[j + 1] == 't':
        return True
    return False

def email(s):
    m = ''
    i = 0
    while i < len(s):
        if is_dot(s, i):
            m += "."
            i += 3
        else:
            if is_at(s, i):
                m += "@"
                i += 2
            else:
                m += s[i]
                i += 1
    return m

print(email(input()))

# ///==========Libraries, Constants and Functions=============///
#mkraghav
import sys

inf = float("inf")
mod = 1000000007

def get_array(): return list(map(int, sys.stdin.readline().split()))

def get_ints(): return map(int, sys.stdin.readline().split())

def input(): return sys.stdin.readline()

def int1():return int(input())

import string

import math

from itertools import combinations
# ///==========MAIN=============///

def main():

    l=(input())
    s=list(l)
    s.pop()
    l=(l.replace('at','@',1))
    if 'dot' in l:
        i=(l.index('dot'))
    if (l.count('dot'))==1:
        l=l.replace('dot','.')

    elif (l.count('dot'))>1 :
        l4=l[:i+3]
        l5=l[i+3:]
        l5=l5.replace('dot','.')
        l=l4+l5
    print(l)

if __name__ == "__main__":
    main()

 # ///==========Libraries, Constants and Functions=============///
#mkraghav
import sys

inf = float("inf")
mod = 1000000007

def get_array(): return list(map(int, sys.stdin.readline().split()))

def get_ints(): return map(int, sys.stdin.readline().split())

def input(): return sys.stdin.readline()

def int1():return int(input())

import string

import math

from itertools import combinations
# ///==========MAIN=============///

def main():

    l=(input())
    j2=len(l)

    s=list(l)
    s.pop()
    j=l[len(l)-4:len(l)-1]

    j3=l.index('at')
    print(j3)
    if j3==0:

        q4=l[:j3+2]
        q5=l[j3+2:]
        q5=q5.replace('at','@',1)
        l=q4+q5
    else:
        l=l.replace('at','@',1)

    if 'dot' in l:
        i=(l.index('dot'))
    else:
        i=100000

    if (l.count('dot'))>=1 and i!=0:
        l=l.replace('dot','.')

    elif i==0 :
        l4=l[:i+3]
        l5=l[i+3:]
        l5=l5.replace('dot','.')
        l=l4+l5

    if j=='dot':

        l=l[:len(l)-2]+'dot'
    print(l)

if __name__ == "__main__":
    main()

# ///==========Libraries, Constants and Functions=============///
#mkraghav
import sys

inf = float("inf")
mod = 1000000007

def get_array(): return list(map(int, sys.stdin.readline().split()))

def get_ints(): return map(int, sys.stdin.readline().split())

def input(): return sys.stdin.readline()

def int1():return int(input())

import string

import math

from itertools import combinations
# ///==========MAIN=============///

def main():

    l=(input())
    s=list(l)
    s.pop()
    l=(l.replace('at','@',1))
    if 'dot' in l:
        i=(l.index('dot'))
    else:
        i=100000

    if (l.count('dot'))>=1 and i!=0:
        l=l.replace('dot','.')

    elif i==0 :
        l4=l[:i+3]
        l5=l[i+3:]
        l5=l5.replace('dot','.')
        l=l4+l5
    print(l)

if __name__ == "__main__":
    main()

 # ///==========Libraries, Constants and Functions=============///
#mkraghav
import sys

inf = float("inf")
mod = 1000000007

def get_array(): return list(map(int, sys.stdin.readline().split()))

def get_ints(): return map(int, sys.stdin.readline().split())

def input(): return sys.stdin.readline()

def int1():return int(input())

import string

import math

from itertools import combinations
# ///==========MAIN=============///

def main():

    l=(input())
    j2=len(l)

    s=list(l)
    s.pop()
    j=l[len(l)-4:len(l)-1]
    l=(l.replace('at','@',1))

    if 'dot' in l:
        i=(l.index('dot'))
    else:
        i=100000

    if (l.count('dot'))>=1 and i!=0:
        l=l.replace('dot','.')

    elif i==0 :
        l4=l[:i+3]
        l5=l[i+3:]
        l5=l5.replace('dot','.')
        l=l4+l5

    if j=='dot':

        l=l[:len(l)-2]+'dot'
    print(l)

if __name__ == "__main__":
    main()

from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest

def binNumber(n,size):
    return bin(n)[2:].zfill(size)

def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)

def iar():
    return list(map(int,input().split()))

def ini():
    return int(input())

def isp():
    return map(int,input().split())

def sti():
    return str(input())

#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|
#  code
if __name__ == "__main__":
    s = sti()
    m = s[0]
    i = 1
    at = 0
    while i < len(s):
        if i+3 <= len(s) and s[i:i+3] == "dot":
            m += "."
            i += 3
        elif i+2 <= len(s) and s[i:i+2] == "at" and at == 0:
            m += "@"
            i += 2
            at = 1
        else:
            m += s[i]
            i += 1
    print(m)

s=input()
s1=s[0]
sm=s[len(s)-1]
s=s[1:len(s)-1].replace('at','@')
s=s1+s[0:len(s)].replace('dot','.')+sm
print(s)

a=input().strip()
a=a.replace('at','@')
a=a.replace('dot','.')
a=list(a)
if a[0]=='.':
  a[0]='dot'
elif a[-1]=='.':
  a[-1]='dot'
f=0
for i in range(len(a)):
  if a[i]=='@' and f==0:
    f=1
  elif a[i]=='@' and f==1:
    a[i]='at'
print(a)

a=input().strip()
a=a.replace('at','@')
a=a.replace('dot','.')
a=list(a)
if a[0]=='.':
  a[0]='dot'
elif a[-1]=='.':
  a[-1]='dot'
f=0
for i in range(len(a)):
  if a[i]=='@' and f==0:
    f=1
  elif a[i]=='@' and f==1:
    a[i]='at'
print(''.join(a))

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from collections import defaultdict
from math import factorial as f
from fractions import gcd as g

s = raw_input ()
s = s.replace ("dot", ".")
s = s.replace ("at", "@")
if s [0] == '.': s = "dot" + s [1:]
if s [0] == '@': s = "at" + s [1:]
if s [-1] == '.': s = s [:-1] + "dot"
if s [-1] == '@': s = s [:-1] + "at"
print s

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
co = 0
c = []
for i in a:
 if i=='@':
  if co > 0:
   c.append('at')
   co = 1
  else:
   c.append('@')
   co = 1
 else:
  c.append(i)
print ''.join(c)

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
b = a.split('@')
c = b[:2]
c = b[0] + '@' + b[1]
b = b[2:]
b = 'at'.join(b)
print c + b

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
print a

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
co = 0
c = []
for i in a:
 if i=='@':
  if co > 0:
   c.append('at')
   co = 1
  else:
   c.append('@')
   co = 1
print ''.join(c)

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
if a[-1] == '@':
 a = a[:-1] + 'at'
print a

from sys import stdin
a = stdin.readline().strip()
a = a.replace('dot','.')
a = a.replace('at','@')
if a[0]=='.':
 a ='dot' + a[1:]
co = 0
c = []
for i in a:
 if i=='@':
  if co > 0:
   c.append('at')
   co = 1
  else:
   c.append('@')
   co = 1
 else:
  c.append(i)
c=  ''.join(c)
if c[-1]=='.':
 c = c[:-1] + 'dot'
print c

import sys

input = sys.stdin

pre = ''
body = input.readline().strip()
suf = ''

if body.startswith('dot'):
  pre = 'dot'
  body = body[3:]
elif body.startswith('at'):
  pre = 'at'
  body = body[2:]

if body.endswith('dot'):
  suf = 'dot'
  body = body[:len(body)-3]
elif body.endswith('at'):
  suf = 'at'
  body = body[:len(body)-2]

print pre + body.replace('dot','.').replace('at','@') + suf

s = raw_input()
if len(s) < 2:
	print s
else:
	print s[0]+s[1:-1].replace('at','@').replace('dot','.')+s[-1]

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
n=raw_input()
kari=n
#print n[1:-1]
n=n[1:-1].replace('dot','.')
n=n[::-1]
n=n.replace('ta','@',1)
n=n[::-1]
print kari[0]+n+kari[-1]

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
n=raw_input()
kari=n
#print n[1:-1]
n=n[1:-1].replace('dot','.')
n=n[::-1]
n=n[1:-1].replace('ta','@',1)
n=n[::-1]
print kari[:2]+n+kari[-2:]

s = raw_input()
if(s.find("at")<>0):
    s = s.replace("at","@",1)
else:
    s = s.replace("at","@",2)
    s = s.replace("@","at",1)

dotpos=-1
if(s.find("dot")==0):
    dotpos=4
elif(s.find("dot")==-1):
    dotpos=0

while(dotpos<>0):
    if(s.find("dot",dotpos)<>0 and s.find("dot",dotpos)<>len(s)-3):
        s = s.replace("dot",".",dotpos)
    dotpos = s.find("dot",dotpos)+1
    print dotpos

if(s[0]=="."):
    s=s[1:]
    s="dot"+s
if(s[len(s)-1]=='.'):
    s=s[:len(s)-1]
    s+="dot"
if(s[0]=="@"):
    s=s[1:]
    s="at"+s
if(s[len(s)-1]=='@'):
    s=s[:len(s)-1]
    s+="at"

print s

s=raw_input()
a=''
at=False
i=1
while i<len(s)-1:
    if not at and s[i:i+2]=='at':
        a+='@'
        at=True
        i+=2
    elif s[i:i+3]=='dot':
        a+='.'
        i+=3
    else:
        a+=s[i]
        i+=1
print s[0]+a+s[-1]

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8

s=raw_input()
s=s.replace('at','@',1)
s=s.replace('dot','.')
if s[0] == '.':
    s=s.replace('.','dot',1)
if s[-1] == '.':
    s = s[:-1] + "dot"

print s

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8

s=raw_input()
s=s.replace('at','@',1)
s=s.replace('dot','.')
if s[0] == '.':
    s=s.replace('.','dot',1)
print s

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8

s=raw_input()
s=s.replace('at','@',1)
s=s.replace('dot','.')
print s

d = {'at':'@',
     'dot':'.'}
s = raw_input()
n = len(s)
i = 0
ss = ""
while i<n:
    s1 = s[i:i+2]
    s2 = s[i:i+3]
    if s1 in d and not(i==0) and not(i==(n-2)):
        ss+=d[s1]
        i += 1
    elif s2 in d and not(i==0) and not(i==(n-2)) and not(i==(n-3)):
        ss+=d[s2]
        i+=2
    else:
        ss+=s[i]
    i+=1
print ss

import sys
from array import array  # noqa: F401

def input():
    return sys.stdin.buffer.readline().decode('utf-8')

s = input()
ans = s[0]
suf = s[:-1]
s = s[1:-1]
at_flag = 0

while s:
    if s[:3] == 'dot':
        ans += '.'
        s = s[3:]
    elif not at_flag and s[:2] == 'at':
        ans += '@'
        at_flag = 1
        s = s[2:]
    else:
        ans += s[0]
        s = s[1:]

print(ans)

from collections import *
from math import *
from sys import *
s = input()
l = [s[0]]
n = len(s)
i = 1
while(i<n):
    if(i < n-3 and s[i:i+3] == "dot"):
        l.append(".")
        i += 3
    elif(i < n-2 and s[i:i+2] == "at"):
        l.append("@")
        i += 2
    else:
        l.append(s[i])
        i += 1
print("".join(l))

#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
#from fractions import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
#vsInput()

s=input()
at=len(s)-((s[-2:0:-1]+s[0]).index('ta')+3)
s=list(s)
s[at:at+2]=['@']
#print(s)

n=len(s)
for i in range(1,n):
    #print(s[i:i+3])
    if(s[i:i+3]==['d','o','t']):
        #print()
        s[i:i+3]=['.']
print(*s,sep="")

#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
#from fractions import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]

#-------------------------code---------------------------#
#vsInput()

s=input()
at=s.index('at')
s=list(s)
s[at:at+2]=['@']
#print(s)

n=len(s)
for i in range(1,n):
    #print(s[i:i+3])
    if(s[i:i+3]==['d','o','t']):
        #print()
        if(i!=len(s)-3):
            s[i:i+3]=['.']
print(*s,sep="")

s=input()

gk=s.replace("at", "@")
gk=gk.replace("dot", ".")
#print(gk)
n=len(gk)
k=list(gk)
if(k[0]=='.'):
	k[0]="dot"
if(k[n-1]=='.'):
	k[n-1]="dot"
if(k[0]=='@'):
	k[0]="at"
if(k[n-1]=='@'):
	k[n-1]="at"
#s=string(k)
for x in range(len(k)):
	print(k[x],end="")
#print(k)

#//print(len(gk))

st = input()
st=st.replace("dot",".")
#print(st)
st=st.replace("at","@")
print(st)

st = input()
p=st[0]
st=st[1:].replace("dot",".")
st=p+st#print(st)
p=st[0]
st=st[1:].replace("at","@",1)
print(p+st)

s = input()

i = s.find('at')
s = s[:i] + '@' + s[i+2:]

while True:
    i = s[1:].find('dot')
    if i == -1:
        break
    i += 1
    if i+3 == len(s):
        break
    s = s[:i] + '.' + s[i+3:]
print(s)