# How to Solve Codeforce 4C in Python?

Codeforces problem 4C, also known as “Registration System”, asks us to implement a registration system that can handle unique usernames.

Here’s how to solve this problem in Python:

``````# Get the number of users
n = int(input())

# Create an empty dictionary to store the usernames and their frequencies
users = {}

# Loop over the users
for i in range(n):
# If the username is already in the dictionary, increment its frequency
# Print the new username with its frequency
else:
# Add the username to the dictionary with a frequency of 0
# Print "OK" since this is a new username
print("OK")``````

In this solution, we first get the number of users using `int(input())`. We then create an empty dictionary called `users` to store the usernames and their frequencies.

We loop over the users using `for i in range(n)`. For each user, we get their username using `input()`.

If the username is already in the dictionary, we increment its frequency using `users[username] += 1`. We then print the new username with its frequency using `print(username + str(users[username]))`.

If the username is not in the dictionary, we add it with a frequency of 0 using `users[username] = 0`. We then print “OK” since this is a new username using `print("OK")`.

Note: This solution assumes that usernames are case-sensitive. If usernames are not case-sensitive, you’ll need to modify the code to account for this.