#include <bits/stdc++.h>
using namespace std;
bool cmp(int a,int b)
{
return a > b;
}
int main()
{
char s[12];
int a[10]={0};
int b[12];
int m,n=0,x1=1;
for(int i = 0; i < 11; i++){
cin >> s[i];
if(a[s[i] - '0'] == 0 && s[i] - '0' != 0)
{ n++;
a[s[i] - '0'] = (s[i] - '0');}
if(s[i] - '0' == 0 && a[s[i] - '0'] == 0 && x1){
n++;
a[s[i] - '0'] = 0;
x1=0;
}
b[i] = s[i] - '0';
}
int t = 0;
int c[20];
sort(a,a+10,cmp);
printf("int[] arr = new int[]{");
for(int i = 0; i < n; i++){
c[a[i]] = t;
if(i != n-1)
printf("%d,",a[i]);
else printf("%d",a[i]);
t++;
}
cout << '}' << ';' << '\n';
int x = 11;
printf("int[] index = new int[]{");
for(int i = 0; i < 11; i++){
if(i != 10)
printf("%d,",c[b[i]]);
else printf("%d};",c[b[i]]);
}
return 0;
}