import java.util.*; import java.util.stream.*; import static java.lang.Math.*; public class Main{ public static void main(String... args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int total=sc.nextInt(); int[] a=new int[n]; for(int i=0;i=0){ if(dp[i-1][j-a[i]]){ dp[i][j]=true; continue; } } if(j%a[i]==0){ if(dp[i-1][j/a[i]]){ dp[i][j]=true; } } } } StringBuilder ans=new StringBuilder(); for(int i=n-1;i>0;i--){ if(dp[i-1][total-a[i]]){ ans.append("+"); total-=a[i]; continue; } if(total%a[i]==0){ if(dp[i-1][total/a[i]]){ ans.append("*"); total/=a[i]; continue; } } throw new IllegalArgumentException(); } ans.reverse(); put(ans); } public static class Pair{ final int x,y; Pair(int x,int y){ this.x=x; this.y=y; } @Override public String toString(){ return String.format("Pair(%d,%d)",x,y); } } public static void print(Object object){ System.out.print(object); } public static void put(Object object) { System.out.println(object); } public static void put(){ System.out.println(); } public static void print(String format,Object... args){ System.out.print(String.format(format,args)); } public static void put(String format,Object... args) { System.out.println(String.format(format,args)); } }