#include<bits/stdc++.h>
#include <algorithm>
using namespace std;

#define ll long long int
#define ull unsigned long long int
#define db double
#define ld long double
#define MOD 1000000007
#define inf (1LL << 62)
#define pi acos(-1.0)
#define si(a) scanf("%lld",&a)
#define sd(n) scanf("%lf", &n)
#define for1(i, stop) for(ll i = 1; i <= stop; i++)
#define for0(i, stop) for(ll i = 0; i < stop; i++)
#define rep1(i, start) for(ll i = start; i >= 1; i--)
#define rep0(i, start) for(ll i = (start-1); i >= 0; i--)
#define loop(i, start, stop, inc) for(ll i = start; i <= stop; i += inc)
#define pb(v,a) v.push_back(a)
#define pll pair <ll, ll>
#define mp make_pair
#define pbp(v,a,i) v.push_back(make_pair(a,i))
#define srt(v) sort(v.begin(),v.end())
#define rv(v) reverse(v.begin(),v.end())
#define ms(n, i) memset(n, i, sizeof(n))
#define debug printf("Debug\n");
#define en '\n'



#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
/*typedef tuple<ll,ll,ll>tpl;

ll bigmod(ll n,ll pow)
{
    if(pow==0)
        return 1;
    if(pow==1)
        return n%MOD;

    ll ans=bigmod(n,pow/2);
    ans=(ans*ans)%MOD;

    if(pow%2==1)
    {
        ans=(ans*n)%MOD;
    }
    return ans%MOD;
}

ll fact[1000005];

ll nCr(ll n,ll r)
{

    ll ans=fact[n];
    ans=(ans*bigmod(fact[r],MOD-2))%MOD;
    ans=(ans*bigmod(fact[n-r],MOD-2))%MOD;
    return ans;
} */

/*ll NcR(ll n, ll r) 
{ 
    ll p = 1, k = 1; 
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) 
    { 
        while (r) 
        { 
            p *= n; 
            k *= r; 
            ll m = __gcd(p, k); 
            p /= m; 
            k /= m; 
  
            n--; 
            r--; 
        } 
    } 
    else
        p = 1;

    return p; 
} */

int main()
{
    _fastio
    double a,b;
    cin>>a>>b;
    cout<<setprecision(6)<<fixed<<(a/100.0)*b<<en;
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#define fo(i,x,y) for(int i = x;i <= y;++i)
#define fd(i,x,y) for(int i = x;i >= y;--i)
using namespace std;
char s1[100],s2[100],s3[110];
int len1,len2,len3,cnt,nm[100],l,s[100];
bool bz[100],bz2[100];
void dg(int x)
{
	if(x > l)
	{
		long long x = 0,y = 0,z = 0;
		if(nm[s[s1[0] - 97]] == 0 || nm[s[s2[0] - 97]] == 0 || nm[s[s3[0] - 97]] == 0) return;
		fo(i,0,len1 - 1) x = x * 10 + nm[s[s1[i] - 97]];
		fo(i,0,len2 - 1) y = y * 10 + nm[s[s2[i] - 97]];
		fo(i,0,len3 - 1) z = z * 10 + nm[s[s3[i] - 97]];
		if(x + y == z && x > 0 && y > 0 && z > 0)
		{
			printf("%lld\n%lld\n%lld\n",x,y,z);
			exit(0);
		}
		return;
	}
	fo(i,0,9)
	{
		if(bz2[i]) continue;
		nm[x] = i,bz2[i] = 1,dg(x + 1),bz2[i] = 0;
	}
}
int main()
{
	scanf("%s%s%s",s1,s2,s3),len1 = strlen(s1),len2 = strlen(s2),len3 = strlen(s3);
	fo(i,0,len1 - 1) bz[s1[i] - 97] = 1;
	fo(i,0,len2 - 1) bz[s2[i] - 97] = 1;
	fo(i,0,len3 - 1) bz[s3[i] - 97] = 1;
	fo(i,0,25)
	{
		cnt += bz[i];
		if(bz[i]) s[i] = ++l;
	}
	dg(1),puts("UNSOLVABLE");
	return 0;
}
