import java.io.*;
import java.util.*;
public class Main {
public static void main
(String[] args
) { int[][] a = {{ 1, 2 }, {3, 4, 5}};
int[][] b = deepCopy(a);
}
private static <T> T deepCopy(T obj) {
try {
oos.writeObject(obj);
oos.close();
@SuppressWarnings("unchecked")
T result = (T) ois.readObject();
return result;
}
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIE1haW4gewogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAgIGludFtdW10gYSA9IHt7IDEsIDIgfSwgezMsIDQsIDV9fTsKICAgICAgICBpbnRbXVtdIGIgPSBkZWVwQ29weShhKTsKICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oQXJyYXlzLmRlZXBUb1N0cmluZyhiKSk7CiAgICB9CiAgICAKICAgIHByaXZhdGUgc3RhdGljIDxUPiBUIGRlZXBDb3B5KFQgb2JqKSB7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgQnl0ZUFycmF5T3V0cHV0U3RyZWFtIGJhb3MgPSBuZXcgQnl0ZUFycmF5T3V0cHV0U3RyZWFtKCk7CiAgICAgICAgICAgIE9iamVjdE91dHB1dFN0cmVhbSBvb3MgPSBuZXcgT2JqZWN0T3V0cHV0U3RyZWFtKGJhb3MpOwogICAgICAgICAgICBvb3Mud3JpdGVPYmplY3Qob2JqKTsKICAgICAgICAgICAgb29zLmNsb3NlKCk7CiAgICAgICAgICAgIEJ5dGVBcnJheUlucHV0U3RyZWFtIGJhaXMgPSBuZXcgQnl0ZUFycmF5SW5wdXRTdHJlYW0oYmFvcy50b0J5dGVBcnJheSgpKTsKICAgICAgICAgICAgT2JqZWN0SW5wdXRTdHJlYW0gb2lzID0gbmV3IE9iamVjdElucHV0U3RyZWFtKGJhaXMpOwogICAgICAgICAgICBAU3VwcHJlc3NXYXJuaW5ncygidW5jaGVja2VkIikKICAgICAgICAgICAgVCByZXN1bHQgPSAoVCkgb2lzLnJlYWRPYmplY3QoKTsKICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgewogICAgICAgICAgICB0aHJvdyBuZXcgVW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24oZSk7CiAgICAgICAgfQogICAgfQp9