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yB7fSB7CiAgICBnbG9iYWwgY2FudiBudW1jb21taXRzIGxpbmVzcGMKCiAgICBzZXQgeW1heCBbbGluZGV4IFskY2FudiBjZ2V0IC1zY3JvbGxyZWdpb25dIDNdCiAgICBpZiB7JHltYXggZXEge30gfHwgJHltYXggPT0gMH0gcmV0dXJuCiAgICBzZXQgZiBbJGNhbnYgeXZpZXddCiAgICBzZXQgeTAgW2V4cHIge2ludChbbGluZGV4ICRmIDBdICogJHltYXgpfV0KICAgIHNldCByMCBbZXhwciB7aW50KCgkeTAgLSAzKSAvICRsaW5lc3BjKSAtIDF9XQogICAgaWYgeyRyMCA8IDB9IHsKCXNldCByMCAwCiAgICB9CiAgICBzZXQgeTEgW2V4cHIge2ludChbbGluZGV4ICRmIDFdICogJHltYXgpfV0KICAgIHNldCByMSBbZXhwciB7aW50KCgkeTEgLSAzKSAvICRsaW5lc3BjKSArIDF9XQogICAgaWYgeyRyMSA+PSAkbnVtY29tbWl0c30gewoJc2V0IHIxIFtleHByIHskbnVtY29tbWl0cyAtIDF9XQogICAgfQogICAgcmV0dXJuIFtsaXN0ICRyMCAkcjFdCn0KCnByb2MgbGF5b3V0bW9yZSB7fSB7CiAgICBnbG9iYWwgcm93bGFpZG91dCByb3dvcHRpbSBjb21taXRpZHggbnVtY29tbWl0cyBvcHRpbV9kZWxheQogICAgZ2xvYmFsIHVwYXJyb3dsZW4KCiAgICBzZXQgcm93ICRyb3dsYWlkb3V0CiAgICBzZXQgcm93bGFpZG91dCBbbGF5b3V0cm93cyAkcm93ICRjb21taXRpZHggMF0KICAgIHNldCBvcm93IFtleHByIHskcm93bGFpZG91dCAtICR1cGFycm93bGVuIC0gMX1dCiAgICBpZiB7JG9yb3cgPiAkcm93b3B0aW19IHsKCWNoZWNrY3Jvc3NpbmdzICRyb3dvcHRpbSAkb3JvdwoJb3B0aW1pemVfcm93cyAkcm93b3B0aW0gMCAkb3JvdwoJc2V0IHJvd29wdGltICRvcm93CiAgICB9CiAgICBzZXQgY2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