#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef struct node{
int data;
struct node *next;
}no;
int main()
{
no n[100];
int key,h;
for(int i=0;i<13;i++)
n[i].next=NULL;
cin>>key;
while(key){
h=key%13;
no* q=new no;
q->data=key;
q->next=n[h].next;
n[h].next=q;
cin>>key;
}
for(int i=0;i<13;i++){
cout<<i<<':';
no *p=n[i].next;
while(p!=NULL){
cout<<p->data<<" ";
p=p->next;
}
cout<<endl;
}
return 0;
}
12-31
1263
08-12
2809