package For_qieZhiPian;
import java.util.Scanner;
public class Test {
public static int target;
public static int zhiTiao[]=new int[6];
public static int flag[];
public static int[] add_res=new int[32];
public static int add(int flag_length){
int sum=0;
for(int i=0;i<flag_length;i++){
if(flag[i]==0){
zhiTiao[i+1]=zhiTiao[i]*10+zhiTiao[i+1];
zhiTiao[i]=-1;
}
}
for(int i=0;i<flag_length+1;i++){
if(zhiTiao[i]!=-1){
sum+=zhiTiao[i];
}
}
if(sum<target){
return sum;
}else{
return -1;
}
}
public static int mi(int y){
if(y==1)
return 1;
return y*mi(y-1);
}
public static void toErjinZhi(int num,int shuzuwei){
while(num>0){
flag[shuzuwei-1]=num%2;
shuzuwei--;
num/=2;
}
}
public static void shuZu(int n,int wei){
for(int i=0;i<n;i++){
toErjinZhi(i,wei);
add_res[i]=add(wei);
}
int max=0;
int max_index=0;
for(int j=0;j<n;j++){
if(add_res[j]!=-1&&max<add_res[j])
max=add_res[j];
max_index=j;
}
int max_count=0;
for(int j=0;j<n;j++){
if(max==add_res[j])
max_count++;
}
if(max_count>1){
System.out.println("rejected");
}else{
}
}
public static void main(String[] args){
int sum=0;
Scanner in=new Scanner(System.in);
target=in.nextInt();
int data=in.nextInt();
int constant_data=data;
int pc=0;
while(data>0){
System.out.println("!!!!!!!!!!!!!!!!!");
zhiTiao[pc++]=data%10;
data/=10;
}
for(int i=pc-1;i>=0;i--){
sum+=zhiTiao[i];
}
flag=new int[pc-1];
int flag_max=mi(pc-1);
if(sum>target){
System.out.println("error");
}else{
System.out.print(target+" ");
}
if(target==constant_data){
System.out.println(target);
}else{
flag=new int[pc-1];
huafen_DFS(0,pc-1);
}
}
}