Yiddishkayt Initiative, Inc.
3301 North University Drive
Suite 100
Coral Springs, FL 33065
PGRpdiBjbGFzcz0ibmVvbkZvcm0iPgo8U0NSSVBUIExBTkdVQUdFPSJKYXZhU2NyaXB0IiBTUkM9Imh0dHBzOi8veWlsb3ZlamV3aXNoLnoyc3lzdGVtcy5jb20vbnAvanMvY2FsZW5kYXIuanMiPjwvU0NSSVBUPgo8Zm9ybSBuYW1lPSJwU2hvcHBpbmdDYXJ0Rm9ybUJlYW4iIG1ldGhvZD0icG9zdCIgYWN0aW9uPSJodHRwczovL3lpbG92ZWpld2lzaC56MnN5c3RlbXMuY29tL25wL3B1YmxpY2FjY2Vzcy9zdXJ2ZXkuZG8iCiAgICAgIG9uc3VibWl0PSJyZXR1cm4gc25pcHBldF92YWxpZGF0ZU5lb25Gb3JtKCk7Ij48aW5wdXQgdHlwZT1wYXNzd29yZCBhdXRvY29tcGxldGU9J25ldy1wYXNzd29yZCcKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZT0nZGlzcGxheTpub25lJz48aW5wdXQgdHlwZT1oaWRkZW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZT0ic2tpcER1cGxpY2F0ZVJlcXVlc3RDaGVjayIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU9IjEiPjxpbnB1dCB0eXBlPWhpZGRlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9InN1cnZleUlkIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlPSIxIi8+PGlucHV0CiAgICAgICAgdHlwZT1oaWRkZW4gbmFtZT0iY3VycmVudFBhZ2UiIHZhbHVlPSIxIi8+PGlucHV0IHR5cGU9aGlkZGVuIG5hbWU9ImRpcmVjdGlvbiIgaWQ9InNuaXBwZXRfZGlyZWN0aW9uIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT0ibmV4dCIvPgogICAgPGRpdiBpZD1zbmlwcGV0X3N1cnZleUZvcm0gY2xhc3M9c25pcHBldF90Ym1haW4+PGlucHV0IHR5cGU9J2hpZGRlbicgbmFtZT0nbmV3X3B1Ymxpc2hfc3VydmV5JyB2YWx1ZT0nMScvPgogICAgICAgIDx0YWJsZSBib3JkZXI9MCB3aWR0aD01MjAgY2VsbHBhZGRpbmc9NSBjZWxsc3BhY2luZz0wPgogICAgICAgICAgICA8dGJvZHk+CiAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgIDx0ZCBjb2xzcGFuPTIgYWxpZ249InJpZ2h0Ij48L3RkPgogICAgICAgICAgICA8L3RyPgogICAgICAgICAgICA8c2NyaXB0PiAgICBpZiAodHlwZW9mIGpRdWVyeSAhPSAidW5kZWZpbmVkIikgewogICAgICAgICAgICAgICAgdmFyIG9sZGpRdWVyeSA9IGpRdWVyeS5ub0NvbmZsaWN0KCk7CiAgICAgICAgICAgIH08L3NjcmlwdD4KICAgICAgICAgICAgCBzcmM9Imh0dHBzOi8veWlsb3ZlamV3aXNoLnoyc3lzdGVtcy5jb20vbnAvanMvanF1ZXJ5LzMuNS4xL2pxdWVyeS0zLjUuMS5taW4uanMiCiAgICAgICAgICAgICAgICAgICAgdHlwZT10ZXh0L2phdmFzY3JpcHQ+PC9zY3JpcHQ+CiAgICAgICAgICAgIDxzY3JpcHQ+ICAgIHZhciBqUXVlcnkxOSA9IGpRdWVyeTsKICAgICAgICAgICAgaWYgKG9sZGpRdWVyeSkgewogICAgICAgICAgICAgICAgalF1ZXJ5ID0gb2xkalF1ZXJ5OwogICAgICAgICAgICAgICAgJCA9IG9sZGpRdWVyeTsKICAgICAgICAgICAgfTwvc2NyaXB0PgogICAgICAgICAgICA8dHIgaWQ9InNuaXBwZXRfcGVyc29uLmZpcnN0TmFtZTEiPgogICAgICAgICAgICAgICAgPHRkIHdpZHRoPTE1MCBjbGFzcz1sZWZ0TGFiZWw+PGxhYmVsPkZpcnN0IE5hbWUgPFNQQU4gY2xhc3M9cmVxdWlyZWQ+KjwvU1BBTj4gPC9sYWJlbD48L3RkPgogICAgICAgICAgICAgICAgPHRkIGNsYXNzPXJpZ2h0RmllbGQ+PGlucHV0IHR5cGU9InRleHQiIG5hbWU9InBlcnNvbi5maXJzdE5hbWUiIG1heGxlbmd0aD0iNDAiIHNpemU9IjM5IiB2YWx1ZT0iIgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkPSJzbmlwcGV0X3BlcnNvbi5maXJzdE5hbWUiIGNsYXNzPSJjb250cm9sX3RleHRib3giPjwvdGQ+CiAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgIDxzY3JpcHQ+aWYgKGpRdWVyeTE5KSB7CiAgICAgICAgICAgICAgICBqUXVlcnkxOShkb2N1bWVudCkucmVhZHkoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGpRdWVyeTE5KCdpbnB1dFt0eXBlPSJwYXNzd29yZCJdJykuYXR0cignYXV0b2NvbXBsZXRlJywgJ25ldy1wYXNzd29yZCcpCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfTwvc2NyaXB0PgogICAgICAgICAgICA8dHIgaWQ9InNuaXBwZXRfcGVyc29uLmxhc3ROYW1lMSI+CiAgICAgICAgICAgICAgICA8dGQgd2lkdGg9MTUwIGNsYXNzPWxlZnRMYWJlbD48bGFiZWw+TGFzdCB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HJvbF90ZXh0Ym94Ij48L3RkPgogICAgICAgICAgICA8L3RyPgogICAgICAgICAgICA8c2NyaXB0PmlmIChqUXVlcnkxOSkgewogICAgICAgICAgICAgICAgalF1ZXJ5MTkoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBqUXVlcnkxOSgnaW5wdXRbdHlwZT0icGFzc3dvcmQiXScpLmF0dHIoJ2F1dG9jb21wbGV0ZScsICduZXctcGFzc3dvcmQnKQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH08L3NjcmlwdD4KICAgICAgICAgICAgPHRyIGlkPSJzbmlwcGV0X2FkZHJlc3MucGhvbmUxMSI+CiAgICAgICAgICAgICAgICA8dGQgd2lkdGg9MTUwIGNsYXNzPWxlZnRMYWJlbD48bGFiZWw+UGhvbmUgPC9sYWJlbD48L3RkPgogICAgICAgICAgICAgICAgPHRkIGNsYXNzPXJpZ2h0RmllbGQ+PGlucHV0IHR5cGU9InRleHQiIG5hbWU9ImFkZHJlc3MucGhvbmUxIiBtYXhsZW5ndGg9IjgwIiBzaXplPSIzOSIgdmFsdWU9IiIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD0ic25pcHBldF9hZGRyZXNzLnBob25lMSIgY2xhc3M9ImNvbnRyb2xfdGV4dGJveCI+PC90ZD4KICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgD5pZiAoalF1ZXJ5MTkpIHsKICAgICAgICAgICAgICAgIGpRdWVyeTE5KGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgalF1ZXJ5MTkoJ2lucHV0W3R5cGU9InBhc3N3b3JkIl0nKS5hdHRyKCdhdXRvY29tcGxldGUnLCAnbmV3LXBhc3N3b3JkJykKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9PC9zY3JpcHQ+CiAgICAgICAgICAgIDx0ciBpZD0ic25pcHBldF9jb21wYW55Q29udGFjdC5jb21wYW55TmFtZTEiPgogICAgICAgICAgICAgICAgPHRkIHdpZHRoPTE1MCBjbGFzcz1sZWZ0TGFiZWw+PGxhYmVsPkNvbXBhbnkgTmFtZSA8L2xhYmVsPjwvdGQ+CiAgICAgICAgICAgICAgICA8dGQgY2xhc3M9cmlnaHRGaWVsZD48aW5wdXQgdHlwZT0idGV4dCIgbmFtZT0iY29tcGFueUNvbnRhY3QuY29tcGFueU5hbWUiIG1heGxlbmd0aD0iMTAwIiBzaXplPSIzOSIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZT0iIiBpZD0ic25pcHBldF9jb21wYW55Q29udGFjdC5jb21wYW55TmFtZSIgY2xhc3M9ImNvbnRyb2xfdGV4dGJveCI+CiAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICA8L3RyPgogICAgICAgICAgICA8c2NyaXB0PmlmIChqUXVlcnkxOSkgewogICAgICAgICAgICAgICAgalF1ZXJ5MTkoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBqUXVlcnkxOSgnaW5wdXRbdHlwZT0icGFzc3dvcmQiXScpLmF0dHIoJ2F1dG9jb21wbGV0ZScsICduZXctcGFzc3dvcmQnKQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH08L3NjcmlwdD4KICAgICAgICAgICAgPHRyIGlkPSJzbmlwcGV0X251bGwxIj4KICAgICAgICAgICAgICAgIDx0ZCB3aWR0aD0xNTAgY2xhc3M9bGVmdExhYmVsPjxsYWJlbD4gPC9sYWJlbD48L3RkPgogICAgICAgICAgICAgICAgPHRkIGNsYXNzPXJpZ2h0RmllbGQ+CiAgICAgICAgICAgICAgICAgICAgD4gICAgaWYgKHR5cGVvZiB3aW5kb3dPbmxvYWRGdW5jID09ICd1bmRlZmluZWQnKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd09ubG9hZEZ1bmMgPSB3aW5kb3cub25sb2FkOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB3aW5kb3cub25sb2FkID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGdyZWNhcHRjaGEgPT0gJ3VuZGVmaW5lZCcgfHwgZ3JlY2FwdGNoYS5yZW5kZXIgPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgiU29tZSBvZiB0aGUgZmllbGRzIG9uIHRoaXMgcGFnZSBkaWQgbm90IGxvYWQgcHJvcGVybHkuIFJlZnJlc2ggdGhlIHBhZ2UgYW5kIHRyeSBhZ2Fpbi4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93T25sb2FkRnVuYykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93T25sb2FkRnVuYygpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfTwvc2NyaXB0PgogICAgICAgICAgICAgICAgICAgIDxzY3JpcHQgc3JjPSdodHRwczovL3d3dy5nb29nbGUuY29tL3JlY2FwdGNoYS9hcGkuanM/cj00MDk5MzY2NDAnPjwvc2NyaXB0PgogICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImctcmVjYXB0Y2hhIiBkYXRhLXNpdGVrZXk9IjZMY3NidzhVQUFBQUFKNkg1dUxlaG9zMGxNWGtIbDNxaVNHRFZmVEoiPjwvZGl2PgogICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9InJlY2FwdGNoYV91bmxpbWl0ZWQiIHZhbHVlPSIxIj48aW5wdXQgdHlwZT0iaGlkZGVuIiBpZD0ic25pcHBldF9nQ2FwdGNoYSIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9ImdDYXB0Y2hhIiB2YWx1ZT0idHJ1ZSI+PC90ZD4KICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgD5pZiAoalF1ZXJ5MTkpIHsKICAgICAgICAgICAgICAgIGpRdWVyeTE5KGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgalF1ZXJ5MTkoJ2lucHV0W3R5cGU9InBhc3N3b3JkIl0nKS5hdHRyKCdhdXRvY29tcGxldGUnLCAnbmV3LXBhc3N3b3JkJykKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9PC9zY3JpcHQ+CiAgICAgICAgICAgIDx0ciBpZD0ic25pcHBldF9zdXJ2ZXkuZGF0YS43LnZhbHVlMSI+CiAgICAgICAgICAgICAgICA8dGQgd2lkdGg9MTUwIGNsYXNzPWxlZnRMYWJlbD48bGFiZWw+TWVzc2FnZSA8L2xhYmVsPjwvdGQ+CiAgICAgICAgICAgICAgICA8dGQgY2xhc3M9cmlnaHRGaWVsZD48dGV4dGFyZWEgbmFtZT0ic3VydmV5LmRhdGEuNy52YWx1ZSIgY29scz0iMzgiIHJvd3M9IjMiIG1heGxlbmd0aD0iMTAyNCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZD0ic25pcHBldF9zdXJ2ZXkuZGF0YS43LnZhbHVlIiBjbGFzcz0iY29udHJvbF90ZXh0YXJlYSI+PC90ZXh0YXJlYT4KICAgICAgICAgICAgICAgIDwvdGQ+CiAgICAgICAgICAgIDwvdHI+CiAgICAgICAgICAgIDxzY3JpcHQ+aWYgKGpRdWVyeTE5KSB7CiAgICAgICAgICAgICAgICBqUXVlcnkxOShkb2N1bWVudCkucmVhZHkoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGpRdWVyeTE5KCdpbnB1dFt0eXBlPSJwYXNzd29yZCJdJykuYXR0cignYXV0b2NvbXBsZXRlJywgJ25ldy1wYXNzd29yZCcpCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfTwvc2NyaXB0PgogICAgICAgICAgICA8dHIgaWQ9InNuaXBwZXRfbnVsbDEiPgogICAgICAgICAgICAgICAgPHRkIGNvbHNwYW49MiBhbGlnbj1jZW50ZXI+PGlucHV0IHR5cGU9InN1Ym1pdCIgbmFtZT0ibnVsbCIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcz0iY29udHJvbF9idXR0b24gc25pcHBldF9jb250cm9sX2J1dHRvbiIgdmFsdWU9IlNFTkQiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ9InNuaXBwZXRfbnVsbCI+PC90ZD4KICAgICAgICAgICAgPC90cj4KICAgICAgICAgICAgD5pZiAoalF1ZXJ5MTkpIHsKICAgICAgICAgICAgICAgIGpRdWVyeTE5KGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgalF1ZXJ5MTkoJ2lucHV0W3R5cGU9InBhc3N3b3JkIl0nKS5hdHRyKCdhdXRvY29tcGxldGUnLCAnbmV3LXBhc3N3b3JkJykKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9PC9zY3JpcHQ+CiAgICAgICAgICAgIDwvdGJvZHk+CiAgICAgICAgPC90YWJsZT4KICAgIDwvZGl2PgogICAgPGlucHV0IHR5cGU9aGlkZGVuIG5hbWU9b3JnSWQgdmFsdWU9eWlsb3ZlamV3aXNoPjwvZm9ybT4KPFNDUklQVCBzcmM9Imh0dHBzOi8veWlsb3ZlamV3aXNoLnoyc3lzdGVtcy5jb20vbnAvanMvcmVnRXhwVmFsaWRhdGUuanMiIHR5cGU9dGV4dC9qYXZhc2NyaXB0PjwvU0NSSVBUPgo8c2NyaXB0PnZhciBtaW5pbXVtQW1vdW50ID0gM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ICBpZiAoZGF5Vi5sZW5ndGggPD0gMiAmJiBkYXlWLmxlbmd0aCA+PSAxICYmIG1vbnRoVi5sZW5ndGggPD0gMiAmJiBtb250aFYubGVuZ3RoID49IDEgJiYgeWVhclYubGVuZ3RoID09IDQpIHsKICAgICAgICB2YXIgcmVnID0gL15cZCskLzsKICAgICAgICB2YXIgciA9IGRhdGUubWF0Y2gocmVnKTsKICAgICAgICBpZiAociA9PSBudWxsKSB7CiAgICAgICAgICAgIGFsZXJ0KCJCaXJ0aCBEYXRlIGlzIGludmFsaWQuIik7CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB2YXIgZCA9IG5ldyBEYXRlKHllYXIudmFsdWUsIG1vbnRoLnZhbHVlIC0gMSwgZGF5LnZhbHVlKTsKICAgICAgICAgICAgdmFyIGMgPSAoZC5nZXRGdWxsWWVhcigpID09IHllYXIudmFsdWUgJiYgKGQuZ2V0TW9udGgoKSArIDEpID09IG1vbnRoLnZhbHVlICYmIGQuZ2V0RGF0ZSgpID09IGRheS52YWx1ZSk7CiAgICAgICAgICAgIGlmICghYykgewogICAgICAgICAgICAgICAgYWxlcnQoIkJpcnRoIERhdGUgaXMgaW52YWxpZC4iKTsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIH0KICAgIGFsZXJ0KCJCaXJ0aCBEYXRlIGlzIGludmFsaWQuIik7CiAgICByZXR1cm4gZmFsc2U7Cn08L1NDUklQVD4KPFNDUklQVCBsYW5ndWFnZT1qYXZhc2NyaXB0IHR5cGU9dGV4dC9qYXZhc2NyaXB0PmZ1bmN0aW9uIHBvcHVsYXRlVmFsdWVGcm9tUmFkaW8odGV4dEJveElkLCByYWRpb0lkLCBoaWRkZW5PYmpJZCkgewogICAgdmFyIHJhZGlvcyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGF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HsKICAgICAgICBpZiAocmFkaW9zW2ldLmNoZWNrZWQpIHsKICAgICAgICAgICAgaGlkZGVuT2JqLnZhbHVlID0gcmFkaW9zW2ldLnZhbHVlOwogICAgICAgICAgICBpZiAodHh0Ym94T2JqICE9IHVuZGVmaW5lZCAmJiAocmFkaW9zW2ldLnZhbHVlID09IG51bGwgfHwgcmFkaW9zW2ldLnZhbHVlID09ICIiKSkgewogICAgICAgICAgICAgICAgdmFyIGRBbXQgPSB0cmltQWxsKHJlbW92ZUN1cnJlbmN5KHR4dGJveE9iai52YWx1ZSkpOwogICAgICAgICAgICAgICAgaWYgKGRBbXQgPT0gIiIpIHsKICAgICAgICAgICAgICAgICAgICBhbGVydCgiUGxlYXNlIGVudGVyIGRvbmF0aW9uIGFtb3VudCIpOwogICAgICAgICAgICAgICAgICAgIHR4dGJveE9iai5mb2N1cygpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsaWRhdGVOdW1lcmljKGRBbXQpID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgYWxlcnQoIlRoZSBkb25hdGlvbiBhbW91bnQgc2hvdWxkIGJlIGEgbnVtYmVyLiIpOwogICAgICAgICAgICAgICAgICAgIHR4dGJveE9iai5mb2N1cygpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsaWRhdGVQb3NpdGl2ZUFuZFplcm8oZEFtdCkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICBhbGVydCgiVGhlIGRvbmF0aW9uIGFtb3VudCBzaG91bGQgYmUgYmlnZ2VyIHRoYW4gMC4iKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbGlkYXRlTnVtZXJpYyhkQW10KSA9PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIG51bWRBbXQgPSBkQW10OwogICAgICAgICAgICAgICAgICAgIG51bWRBbXQgPSBudW1kQW10LnJlcGxhY2UoJywnLCAnJyk7CiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG51bWRBbXQuaW5kZXhPZignLCcpICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG51bWRBbXQgPSBudW1kQW10LnJlcGxhY2UoJywnLCAnJyk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIG51bWRBbXQgPSBudW1kQW10LnNwbGl0KCcuJyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKG51bWRBbXRbMF0ubGVuZ3RoID4gMTMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQoJ1lvdXIgZG9uYXRpb24gYW1vdW50IGlzIHRvbyBsYXJnZS4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBpZiAoaXNDaGVja2VkKCdyZWN1cnJpbmdGbGFnJywgJzEnKSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsaWRhdGVNaW5pbXVtUmVjdXJyaW5nKGRBbXQpID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgiWW91IGhhdmUgbm90IGVudGVyZWQgdGhlIG1pbmltdW0gcmVjdXJyaW5nIGRvbmF0aW9uIGFtb3VudCBvZiAkIiArIE51bWJlcihtaW5pbXVtUmVjdXJyaW5nKS50b0ZpeGVkKDIpICsgJy4nKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZGF0ZU1pbmltdW1BbW91bnQoZEFtdCkgPT0gZmFsc2UpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KCdZb3UgaGF2ZSBub3QgZW50ZXJlZCB0aGUgbWluaW11bSBkb25hdGlvbiBhbW91bnQgb2YgICQnICsgTnVtYmVyKG1pbmltdW1BbW91bnQpLnRvRml4ZWQoMikgKyAnLicpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGhpZGRlbk9iai52YWx1ZSA9IGRBbXQ7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgfQogICAgfQp9CgpmdW5jdGlvbiB2YWxpZGF0ZVBvc2l0aXZlQW5kWmVybyh2YWwpIHsKICAgIGlmIChOdW1iZXIodmFsKSA8PSAwKSB7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQp9CgpmdW5jdGlvbiB2YWxpZGF0ZU1pbmltdW1BbW91bnQodmFsKSB7CiAgICBpZiAobWluaW11bUFtb3VudCAmJiBtaW5pbXVtQW1vdW50ID4gMCAmJiBtaW5pbXVtQW1vdW50ID4gdmFsKSB7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQogICAgcmV0dXJuIHRydWU7Cn0KCmZ1bmN0aW9uIHZhbGlkYXRlTWluaW11bVJlY3VycmluZyh2YWwpIHsKICAgIGlmIChtaW5pbXVtUmVjdXJyaW5nICYmIG1pbmltdW1SZWN1cnJpbmcgPiAwICYmIG1pbmltdW1SZWN1cnJpbmcgPiB2YWwpIHsKICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQoKZnVuY3Rpb24gaXNDaGVja2VkKG5hbWUsIHZhbHVlKSB7CiAgICB2YXIgbGlzdCA9IGdld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IGFsZXJ0KCJUaGUgZG9uYXRpb24gYW1vdW50IHNob3VsZCBiZSBiaWdnZXIgdGhhbiAwLiIpOwogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfSBlbHNlIGlmICh2YWxpZGF0ZU51bWVyaWMoZEFtdCkgPT0gdHJ1ZSkgewogICAgICAgICAgICB2YXIgbnVtZEFtdCA9IGRBbXQ7CiAgICAgICAgICAgIG51bWRBbXQgPSBudW1kQW10LnJlcGxhY2UoJywnLCAnJyk7CiAgICAgICAgICAgIHdoaWxlIChudW1kQW10LmluZGV4T2YoJywnKSAhPSAtMSkgewogICAgICAgICAgICAgICAgbnVtZEFtdCA9IG51bWRBbXQucmVwbGFjZSgnLCcsICcnKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBudW1kQW10ID0gbnVtZEFtdC5zcGxpdCgnLicpOwogICAgICAgICAgICBpZiAobnVtZEFtdFswXS5sZW5ndGggPiAxMykgewogICAgICAgICAgICAgICAgYWxlcnQoJ1lvdXIgZG9uYXRpb24gYW1vdW50IGlzIHRvbyBsYXJnZS4nKTsKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoaXNDaGVja2VkKCdyZWN1cnJpbmdGbGFnJywgJzEnKSkgewogICAgICAgICAgICAgICAgaWYgKHZhbGlkYXRlTWluaW11bVJlY3VycmluZyhkQW10KSA9PSBmYWxzZSkgewogICAgICAgICAgICAgICAgICAgIGFsZXJ0KCJZb3UgaGF2ZSBub3QgZW50ZXJlZCB0aGUgbWluaW11bSByZWN1cnJpbmcgZG9uYXRpb24gYW1vdW50IG9mICQiICsgTnVtYmVyKG1pbmltdW1SZWN1cnJpbmcpLnRvRml4ZWQoMikgKyAnLicpOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGlmICh2YWxpZGF0ZU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