/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
Expression[] exps = new Expression[100];
for (int i = 0; i < exps.length; ++i)
{
exps[i] = null;
}
for (int a = 2; a <= 9; ++a)
{
for (int b = 2; b <= 9; ++b)
{
for (int c = 2; c <= 9; ++c)
{
Expression exp = new Expression(a, b, c);
int index = exp.index;
exps[index] = simply(exps[index], exp);
}
}
}
for (int i = 0; i < exps.length; ++i)
{
if (exps[i] != null)
{
if (exps[i].result % 5 == 0)
{
}
}
}
}
static Expression simply(Expression exp1, Expression exp2)
{
if (exp1 == null) return exp2;
if (exp2 == null) return exp1;
return exp1.simple >= exp2.simple ? exp1 : exp2;
}
static class Expression
{
public final int a, b, c, result, simple, index;
public Expression(int a, int b, int c)
{
this.a = a;
this.b = b;
this.c = c;
result = a * b - c;
index = result + 9;
simple = (a == b ? 5 : 0)
+ (a == c ? 1 : 0)
+ (b == c ? 5 : 0)
+ (a <= b && b <= c ? 1 : 0)
+ (a >= b && b >= c ? 1 : 0);
}
@Override
{
return a + " x " + b + " - " + c + " = " + result;
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCQlFeHByZXNzaW9uW10gZXhwcyA9IG5ldyBFeHByZXNzaW9uWzEwM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