#include <iostream>
#include <cstdio>
#include <vector>
using namespace std
;
vector
<int> a
;
vector
<int> b
;
vector
<int> c
;
int main()
{
int n
;
cin
>>n
;
for(int i
=0;i
<n
;i
++){
int tmp
;
cin
>>tmp
;
if(tmp
%10==1||tmp
%10==4||tmp
%10==7){
a
.push_back(tmp
);
}else if(tmp
%10==2||tmp
%10==5||tmp
%10==8){
b
.push_back(tmp
);
}else if(tmp
%10==3||tmp
%10==6||tmp
%10==9){
c
.push_back(tmp
);
}
}
for(int i
=0;i
<a
.size();i
++){
if(i
==0)cout
<<a
[i
];
else cout
<<" "<<a
[i
];
}
cout
<<endl
;
for(int i
=0;i
<b
.size();i
++){
if(i
==0)cout
<<b
[i
];
else cout
<<" "<<b
[i
];
}
cout
<<endl
;
for(int i
=0;i
<c
.size();i
++){
if(i
==0)cout
<<c
[i
];
else cout
<<" "<<c
[i
];
}
cout
<<endl
;
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-34674.html