#include <bits/stdc++.h>
/*
* Payment method Problem
*
* Se considera n (n<=1000) tipuri de bancnote, de valori diferite,
* din fiecare existand un numar nelimitat de bucati. Sa se determine
* o modalitate de plata, a valorii S, folosind un numar minim de bancnote.
#
# We consider N (N<=1000) types of banknotes, of different values,
# of each there being an unlimited number of pieces. Determine a payment
# method of payment, of value S using a minimum numbers of banknotes.
#
# Input:
# N = 5
# S = 100
# 3,15,1,5,2
#
# Output: 6 * 15
# 2 * 5
*/
int B[ 1001 ],
N,
S;
void load() {
scanf("%d %d", &N,&S);
for(int i = 0; i < N; ++i) scanf("%d", &B[i]);
}
void sort(int sign) {
int aux,j;
for(int i = 1; i < N; ++i) {
j = i - 1;
aux = B[i];
while(j>=0 && B[j]*sign>aux*sign) {
B[j+1] = B[j];
j--;
}
B[j+1] = aux;
}
}
void solve() {
sort(-1);
int sum;
for(int i = 0; i < N; ++i) {
if(S>=B[i]) printf("%d * %d\n", S/B[i],B[i]);
S -= (S / B[i]) * B[i];
if(!S) break;
}
if( S > 0 )printf("No Solution!");
}
int main(int argc, char const *argv[]) {
load();
solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Ci8qCiAqIFBheW1lbnQgbWV0aG9kIFByb2JsZW0KICoKICogU2UgY29uc2lkZXJhIG4gKG48PTEwMDApIHRpcHVyaSBkZSBiYW5jbm90ZSwgZGUgdmFsb3JpIGRpZmVyaXRlLAogKiBkaW4gZmllY2FyZSBleGlzdGFuZCB1biBudW1hciBuZWxpbWl0YXQgZGUgYnVjYXRpLiAgU2Egc2UgZGV0ZXJtaW5lCiAqIG8gbW9kYWxpdGF0ZSBkZSBwbGF0YSwgYSB2YWxvcmlpIFMsIGZvbG9zaW5kIHVuIG51bWFyIG1pbmltIGRlIGJhbmNub3RlLgoKICMKICMgV2UgY29uc2lkZXIgTiAoTjw9MTAwMCkgdHlwZXMgb2YgYmFua25vdGVzLCBvZiBkaWZmZXJlbnQgdmFsdWVzLAogIyBvZiBlYWNoIHRoZXJlIGJlaW5nIGFuIHVubGltaXRlZCBudW1iZXIgb2YgcGllY2VzLiBEZXRlcm1pbmUgYSBwYXltZW50CiAjIG1ldGhvZCBvZiBwYXltZW50LCBvZiB2YWx1ZSBTIHVzaW5nIGEgbWluaW11bSBudW1iZXJzIG9mIGJhbmtub3Rlcy4KICMKICMgSW5wdXQ6CiAjIE4gPSA1CiAjIFMgPSAxMDAKICMgICAgICAgICAzLDE1LDEsNSwyCiAjCiAjIE91dHB1dDogNiAqIDE1CiAjICAgICAgICAgMiAqIDUKICovCmludCBCWyAxMDAxIF0sCiAgICBOLAogICAgUzsKCnZvaWQgbG9hZCgpIHsKICAgc2NhbmYoIiVkICVkIiwgJk4sJlMpOwogICBmb3IoaW50IGkgPSAwOyBpIDwgTjsgKytpKSBzY2FuZigiJWQiLCAmQltpXSk7Cn0KCnZvaWQgc29ydChpbnQgc2lnbikgewoKICAgICBpbnQgYXV4LGo7CgogICAgIGZvcihpbnQgaSA9IDE7IGkgPCBOOyArK2kpIHsKCiAgICAgICAgIGogPSBpIC0gMTsKICAgICAgICAgYXV4ID0gQltpXTsKCiAgICAgICAgIHdoaWxlKGo+PTAgJiYgQltqXSpzaWduPmF1eCpzaWduKSB7CiAgICAgICAgICAgQltqKzFdID0gQltqXTsKICAgICAgICAgICBqLS07CiAgICAgICAgIH0KICAgICAgICAgQltqKzFdID0gYXV4OwogICAgIH0KfQoKdm9pZCBzb2x2ZSgpIHsKCiAgICAgc29ydCgtMSk7CiAgICAgaW50IHN1bTsKICAgICBmb3IoaW50IGkgPSAwOyBpIDwgTjsgKytpKSB7CiAgICAgICAgIGlmKFM+PUJbaV0pIHByaW50ZigiJWQgKiAlZFxuIiwgUy9CW2ldLEJbaV0pOwogICAgICAgICBTIC09IChTIC8gQltpXSkgKiBCW2ldOwogICAgICAgICBpZighUykgYnJlYWs7CiAgICAgfQogICAgIGlmKCBTID4gMCApcHJpbnRmKCJObyBTb2x1dGlvbiEiKTsKfQoKaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgY29uc3QgKmFyZ3ZbXSkgewoKICBsb2FkKCk7CiAgc29sdmUoKTsKCiAgcmV0dXJuIDA7Cn0K