#!/usr/bin/python

import sys
import re
toops =[]
for n in sys.stdin.readlines():
        ip = n.split(None,1)[0]
        tbytes = n.split(None,1)[1]
        toop = (ip,tbytes)
        toops.append(toop)
toops = sorted(toops, key = lambda toop: toop[1], reverse=True)
for toop in toops:
    sys.stdout.write(toop[0]+' '+toop[1])
sys.stdout.flush()
7a3049818feb23b14a5f0eed514b116ca11c430f
<mask token>

<mask token>
for n in sys.stdin.readlines():
    ip = n.split(None, 1)[0]
    tbytes = n.split(None, 1)[1]
    toop = ip, tbytes
    toops.append(toop)
<mask token>
for toop in toops:
    sys.stdout.write(toop[0] + ' ' + toop[1])
sys.stdout.flush()

<mask token>
toops = []
for n in sys.stdin.readlines():
    ip = n.split(None, 1)[0]
    tbytes = n.split(None, 1)[1]
    toop = ip, tbytes
    toops.append(toop)
toops = sorted(toops, key=lambda toop: toop[1], reverse=True)
for toop in toops:
    sys.stdout.write(toop[0] + ' ' + toop[1])
sys.stdout.flush()

import sys
import re
toops = []
for n in sys.stdin.readlines():
    ip = n.split(None, 1)[0]
    tbytes = n.split(None, 1)[1]
    toop = ip, tbytes
    toops.append(toop)
toops = sorted(toops, key=lambda toop: toop[1], reverse=True)
for toop in toops:
    sys.stdout.write(toop[0] + ' ' + toop[1])
sys.stdout.flush()

#!/usr/bin/python

import sys
import re
toops =[]
for n in sys.stdin.readlines():
        ip = n.split(None,1)[0]
        tbytes = n.split(None,1)[1]
        toop = (ip,tbytes)
        toops.append(toop)
toops = sorted(toops, key = lambda toop: toop[1], reverse=True)
for toop in toops:
    sys.stdout.write(toop[0]+' '+toop[1])
sys.stdout.flush()