// Arup Guha
// 10/28/2026
// Solution to COP 3330 Fall 2026 Program 7B: Concert Sponsors

import java.util.*;

public class Sponsors {
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int numOps = Integer.parseInt(stdin.nextLine());
		
		// Empty map.
		HashMap<String,String> sponsorMap = new HashMap<String,String>();
		
		// Process operations.
		for (int loop=0; loop<numOps; loop++) {
			
			// Get operation.
			int op = Integer.parseInt(stdin.nextLine());
			
			// Update sponsor.
			if (op == 1) {
				
				// Read band, sponsor, add to map.
				String band = stdin.nextLine();
				String sponsor = stdin.nextLine();
				sponsorMap.put(band, sponsor);
			}
			
			// Remove from the map.
			else if (op == 2) {
				
				String band = stdin.nextLine();
				sponsorMap.remove(band);
			
			}
			
			// Retrieve a sponsor.
			else {
			
				// Get band.
				String band = stdin.nextLine();
				
				// It's in the map output accordingly.
				if (sponsorMap.containsKey(band))
					System.out.println(sponsorMap.get(band));
					
				// Case for no sponsor.
				else
					System.out.println("No sponsor");
			}
		}
	}
}