import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.PriorityQueue;
public class Main {
final private int BUFFER_SIZE = 1 << 16;
private byte[] buffer;
private int bufferPointer, bytesRead;
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
buffer = new byte[BUFFER_SIZE];
bufferPointer = bytesRead = 0;
}
byte[] buf = new byte[64]; // line length
int cnt = 0, c;
while ((c = read()) != -1) {
if (c == '\n') {
break;
}
buf[cnt++] = (byte) c;
}
return new String(buf,
0, cnt
);
}
int ret = 0;
byte c = read();
while (c <= ' ') {
c = read();
}
boolean neg = (c == '-');
if (neg) {
c = read();
}
do {
ret = ret * 10 + c - '0';
} while ((c = read()) >= '0' && c <= '9');
if (neg) {
return -ret;
}
return ret;
}
bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
if (bytesRead == -1) {
buffer[0] = -1;
}
}
if (bufferPointer == bytesRead) {
fillBuffer();
}
return buffer[bufferPointer++];
}
if (din == null) {
return;
}
din.close();
}
}
public static void main
(String[] args
){// throws IOException { Map
<String,Integer
> mp
=new HashMap
<>(); PriorityQueue<String> pq=new PriorityQueue<>(new Comparator<String>(){
@Override
return mp.get(t)-mp.get(t1);
}
});
int n=-1;
try
{
sc.readLine();
}
return;
}
int x=1;
StringBuilder sba=new StringBuilder("");
while(x<=n){
try
{
h=sc.readLine().split(" ");
sc.readLine();
}
return ;
}
// System.out.print("string for this input is ");
// for (int i = 0; i < h.length; i++) {
// System.out.print(h[i]+" , ");
// }
// System.out.println("");
if(type!=3){
mp.put(h[1].intern(),newVal);
if(!pq.isEmpty()){
while(!pq.isEmpty() && pq.remove(h[1].intern()))
pq.remove(h[1].intern());
}
pq.offer(h[1].intern());
}
else{
while(!pq.isEmpty() && pq.remove(j.intern()))
pq.remove(j.intern());
sba.append(j+" "+x).append("\n\n");
}
x+=1;
// System.out.println("x= "+x);
}
System.
out.
println(sba.
toString()); }
}