import java.util.*;
import java.lang.*;
class Main
{
{
byte[] input = {77, 83, 65, 80, 79, 67, 32, 32, 32, 32, 32, 32, 32};
int i = input.length;
while (i-- > 0 && input[i] == 32) {}
byte[] output = new byte[i+1];
System.
arraycopy(input,
0, output,
0, i
+1);
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCWJ5dGVbXSBpbnB1dCA9IHs3NywgODMsIDY1LCA4MCwgNzksIDY3LCAzMiwgMzIsIDMyLCAzMiwgMzIsIDMyLCAzMn07CgkJaW50IGkgPSBpbnB1dC5sZW5ndGg7CgkJd2hpbGUgKGktLSA+IDAgJiYgaW5wdXRbaV0gPT0gMzIpIHt9CgoJCWJ5dGVbXSBvdXRwdXQgPSBuZXcgYnl0ZVtpKzFdOwoJCVN5c3RlbS5hcnJheWNvcHkoaW5wdXQsIDAsIG91dHB1dCwgMCwgaSsxKTsKCQkKCQlTeXN0ZW0ub3V0LnByaW50bG4oQXJyYXlzLnRvU3RyaW5nKGlucHV0KSk7CgkJU3lzdGVtLm91dC5wcmludGxuKEFycmF5cy50b1N0cmluZyhvdXRwdXQpKTsKCX0KfQ==
[77, 83, 65, 80, 79, 67, 32, 32, 32, 32, 32, 32, 32]
[77, 83, 65, 80, 79, 67]