/* 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
{
private static void permutation
(char[] perm,
int pos,
String str
) { if (pos == perm.length) {
} else {
for (int i = 0 ; i < str.length() ; i++) {
perm[pos] = str.charAt(i);
permutation(perm, pos+1, str);
}
}
}
{
char[] perm = new char[3];
permutation(perm, 0, "2424");
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCQpwcml2YXRlIHN0YXRpYyB2b2lkIHBlcm11dGF0aW9uKGNoYXJbXSBwZXJtLCBpbnQgcG9zLCBTdHJpbmcgc3RyKSB7CiAgICBpZiAocG9zID09IHBlcm0ubGVuZ3RoKSB7CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKG5ldyBTdHJpbmcocGVybSkpOwogICAgfSBlbHNlIHsKICAgICAgICBmb3IgKGludCBpID0gMCA7IGkgPCBzdHIubGVuZ3RoKCkgOyBpKyspIHsKICAgICAgICAgICAgcGVybVtwb3NdID0gc3RyLmNoYXJBdChpKTsKICAgICAgICAgICAgcGVybXV0YXRpb24ocGVybSwgcG9zKzEsIHN0cik7CiAgICAgICAgfQogICAgfQp9CQoJCgkKCQoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CmNoYXJbXSBwZXJtID0gbmV3IGNoYXJbM107CnBlcm11dGF0aW9uKHBlcm0sIDAsICIyNDI0Iik7Cgl9Cn0=