#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 5e4 + 10;
const int INF = (1 << 30);
int t, n, m, x, y, z, ans, sum;
int a[maxn], ha[maxn], vis[maxn], deg[maxn], dis[maxn], path[maxn];
struct node {
char str[25];
int cnt;
node *l, *r;
};
node *inster(node *head, char *s) {
if(!head) {
head = new node;
head->cnt = 1;
strcpy(head->str, s);
head->l = head->r = NULL;
} else {
int cmp = strcmp(head->str, s);
if(cmp > 0) {
head->l = inster(head->l, s);
} else if(cmp < 0) {
head->r = inster(head->r, s);
} else {
head->cnt++;
}
}
return head;
}
void put(node *head) {
if(head) {
put(head->l);
printf("%s %.2lf%c\n", head->str, head->cnt * 100.0 / n, '%');
put(head->r);
}
}
int main() {
node *head = NULL;
char str[25];
scanf("%d", &n);
getchar();
for(int i = 1; i <= n; i++) {
gets(str);
int len = strlen(str);
for(int j = 0; j < len; j++) {
if(str[j] >= 'A' && str[j] <= 'Z') {
str[i] += 32;
}
}
head = inster(head, str);
}
put(head);
getchar();
return 0;
}