drew up the opinion of the Court. This is an acdon against the town of Worcester, brought by the treasurer of the State Lunatic Hospital, upon the provisions of the St. 1834, c. 150, being the last general act, for the administration of the affairs of that hospital. * The action is *73founded wholly on the statute ; it is instituted by the plaintiff in aider droit, having no personal right or claim, and he can maintain it only by bringing himself within the provisions of the statute. The several preceding acts respecting the State Lunatic Hospital, (St. 1832, c. 163, St. 1833, c. 1, and St. 1833, c. 95,) are in terms repealed by this act, without any limitation or saving clause, and though they may be referred to, as a means of expounding the present act, yet the rule of law upon which, if at all, the plaintiff can recover, must be found in this statute.
We have found great difficulty in giving a satisfactory construction to all the parts of this statute, in reconciling its various provisions, and in ascertaining by the ordinary rules of exposition, what was the true meaning and intent of the legislature. This probably arises from the fact, that the subject was a new one, and that it necessarily had reference to a great variety of provisions, scattered over the whole body of the statute law, relative to the relief and support of various classes of paupers and prisoners.
The remedy given to the trustees of the hospital, by an action in the name of the treasurer, is founded on the 7th section, which provides that the accounts of the hospital, for the support of all patients committed thereto, in all cases where other and ample security is not taken, satisfactory to the trustees, shall be regularly charged to, and shall be paid by the town or city, where the patient resided, at the time of the application for commitment. It then provides, that if the town or city thus charged, shall fail'to pay, the trustees shall be entitled to an action on the case, to be commenced and prosecuted in the name of the treasurer, to recover against such delinquent town or city. And such town or city shall have the same rights and remedies against all corporations and persons, as if such expense had been incurred by said town or city, in the ordinary support of such lunatic. This is the whole of the remedy of the hospital. They cannot charge the patient himself, if he be of sufficient ability to provide for his own support; they cannot charge those relatives, if any who are bound by law to support him ; they cannot ever charge the town of his legal settlement, unless it happen also *74to be the town where he resided, at the time oí the application for his commitment.
The first principal difficulty is, in determining the meaning intended by the legislature to be put upon the word “ resided,” in the various places in which it is used in this act. It must, we think, have the same meaning, as used in difieren* parts of the act, and therefore if it is ascertained how it is to be understood in one place, it will assist in explaining its meaning in another. =
Some views of the act would lead to the belief, that it was intended to be used in a sense broad enough to include the town of his legal settlement, or his actual domicil or casual residence, according to circumstances, because otherwise the hospital has no remedy against the town liable for his support, though perfectly well known, if it did not also happen to be the place of his residence at the time. But we are satisfied on reflection, that it will not admit of this construction. It would be doing violence to the'plain meaning and force of the language. If, for instance, the patient had a legal settlement in one town, and an actual home in another, it would not be a forced construction merely, but an entire perversion of language, to call the former “ the town where he resided.” Further, it is provided, in § 6, that the tribunal or magistrate having power to order commitments to the hospital, shall, in the order of commitment, certify the name of the town in which the person committed may reside, at the time of the application for such commitment, and such certificate shall be conclusive evidence of the fact. The question, where a lunatic or madman happened to be, when taken up, to prevent his doing mischief to himself or others, to be sent by the proper magistrate to this retreat, on proper application forx that purpose, is a simple matter of fact, easily ascertained and in regard to which there could be little danger of mistake. The law might therefore properly intrust this inquiry to the magistrate, and make his certificate conclusive. But a question of legal settlement, is often a very complicated one, involving difficult and controverted questions, both of law and fact, and it cannot for a moment be believed, that the law ntended to confer the power of "ettling it conclusively, upon *75such magistrate, on a summary hearing for another purpose. The conclusion seems to be inevitable, that in this act, “ residence ” was understood to be wholly distinct from “ legal sett.eir.ant.” Both circumstances might coincide in a particular case; but even then it would be the fact of residence, and not of settlement, on which the right of the hospital would depend.
But supposing we could put a satisfactory construction upon the word “resided,” there seems to be another provision in the statute, as we understand it, attended with more difficulty, considering the statute as designed to establish a uniform system for charging the support of patients, upon those, who by other and distinct legal provisions, are made chargeable with it.
The support is to be charged to the town where the patient resided, at the time of the application for commitment, and the name of such town is to be certified in the order of commitment. It seems therefore, that this provision applies only to the cases of those patients who have been committed on application. This manifestly refers to the cases of those contemplated in the 4th section of the statute, who are to be committed by the judges of probate in the several counties, and the judge of the Municipal Court, in the county of Suffolk ; and what strengthens this conclusion is, that the same section provides that the persons applying for such commitment of a lunatic, shall give notice to the town where he resides, of their intention to do so.
From this provision two inferences of the intent of the legislature, we think, may be drawn, namely ; 1. that the town contemplated to be charged by the provision in § 7, shall have had notice previously to the accruing of the expense, that such expense is to be charged to them, and an opportunity to oppose such commitment, if in their judgment it is unnecessary or useless, or if there be other good ground to do so ; 2. that such commitment can only be made upon the application of some person, to the judges designated, as provided in § 3, in a case where it is manifestly dangerous to the peace and safety of the community, that such lunatic should continue at large. This gives a plain and practical effect to the pro*76vision, that the town where the patient resided, at the time of such application, is the town to be charged ; such town having had the required notice. But it follows from this, that no provision is made for giving the hospital any remedy for the support of any other class of patients, (except town paupers and poor patients, as hereafter stated,) than those who are thus committed by the judges of probate and judge of the Municipal Court, and of course, that all other classes of patients are to be supported by the hospital, out of its own resources.
This statute in connexion with those repealed, obviously refers to five classes of patients, who may be relieved at the hospital.
1. Town paupers, who may be received by the trustees ; and they are encouraged hy the terms and provisions of the act in § 5, to receive them upon favorable conditions. And they are authorized also to receive other poor patients, whether supported at public expense or not, at their discretion, even at a less sum than the actual cost of their support. But as the trustees are not compellable to receive such patients, it is obviously contemplated by the statute, that their admission is to be matter of contract, between the officers of towns or the friends of such poor patients respectively, and the trustees ; they may require such stipulations and securities as will ensure them an indemnity. These are, no doubt, the cases contemplated in § 7, where other and ample security satisfactory to the trustees is taken, and which are consequently excepted from the cases where the support is to be charged to the town of the patient’s residence. In regard to these, as the compensation and security of the hospital is to be regulated by contract, the trustees have the power in their own hands, and no question upon the statute is likely to arise.
2. All those persons, who previously to the issuing of the governor’s proclamation under St. 1833, c. 1, had been confined in prison by the orders and sentences of the Supreme Judicial Court, and other courts having criminal jurisdiction, pursuant to St. 1816, c. 28, and who remained in confinement m the common gaols of the several counties, and were removed in pursuance of that proclamation. This statute pro *77vided, that persons charged with crimes, who on trial should be acquitted on the ground of insanity, or whom the grand jury should forbear to indict, expressly by reason of insanity, and the going at large of such person should be deemed dangerous to the safety of the citizens, might be committed to prison, there to be detained until restored to their right mind. St. 1816, c. 28, § 1.
Many persons, it is understood, who had been committed by force of this provision, remained in the gaols of the various counties of the Commonwealth, some of whom had been in close custody for many years. Indeed the miserable condition of this class of unhappy prisoners, was one of the most powerful motives, it is believed, which induced the legislature ■ to establish this humane asylum.
The same statute provided, that such person should be kept at his own expense, if he had estate sufficient for that purpose ; otherwise at the charge of the person or town, upon whom his maintenance would have been legally chargeable," had he not been so committed to prison. By St. 1832, c. 163, § 4, being the first act providing general regulations for administering the affairs of the hospital, it was provided, that the trustees of the hospital should have the same powers, which keepers of gaols and houses of correction before had, against delinquent towns and individuals, in regard to the expenses incurred- by those committed to the hospital by virtue of the several statutes, as modified by that act. But as this last statute, together with that of 1816, is repealed, without the re-enactment of this provision, it seems quite clear, that the hospital has not now the remedy against towns and individuals, which was given by those statutes. And as we think it inconsistent with the obvious intent of the statute now m force, to consider these prisoners as persons committed to the hospital, on application and notice to the town of their residence, especially as there was no provision for giving such notice prior to the act of 1834, it follows, that there is no town to which the trustees can make the charge, and they are without remedy. Possibly the patient himself, if of sufficient ability to pay for his own support, might be liable, by the principles of the common law, as upon an implied promise, *78for necessaries, either to the trustees or to the Commonwealth, but of this we give no opinion. We think they would have none of the statute remedies.
3. All those persons, who at the time of the proclamation and removal .of prisoners, were in custody in the several houses of correction, committed by two justices quorum unus, as lunatics and persons dangerous" to the peace and safety of the people, by St. 1797, c. 62, § 3. This statute also provided that the person thus committed should be kept at his own expense, if he had estate, otherwise, at the charge of the person or town upon whom his maintenance was to be regularly charged. Whether this clause was modified at all by St. 1826, c. 142, is immaterial.
The same remark applies to this class, as to the preceding By St. 1832, c. 163, § 4, the power of the masters of houses of correction, to look to the individual ór town liable for the support of the lunatic, was transferred to the trustees of the hospital. But as both statutes are repealed by that of 1834, without reviving this provision, the truste.es are now without remedy.
The power given to two justices, quorum unus, to commit persons dangerous to the community by reason of their insan ity, is now taken away and transferred to judges of probate and the judge of the Municipal Court; and these, with the judicial courts having criminal jurisdiction, have now the sole authority to commit persons to close custody, for this cause, whether committed on a charge of crime and excused on the ground of insanity or not. And by St. 1834, c. 150, all such persons, of both classes, are to be committed to the hospital.
4. Persons committed by judges of probate and the judge of the Municipal Court, on the application of any person, in a case where it is dangerous to the ■ community that such lunatic should continue at large ; and with notice to the town where such person residéd, at the time of such application, pursuant to St. 1834, c. 150, § 3,. This can only apply to persons committed since the passage of that act. In this case the remedy of the trustees seems plain and adequate, by charging the support to the town where such person resided at the time of the application, giving them an indemnity over.
*79A person seized with a paroxysm of insanity, is presumed to be incapable of taking care of himself, and a regard to his own safety, as well as that of others, requires, that it should be made the duty of some one, to provide for his immediate restraint and relief. Such lunatic must be, either a stranger 4o the State, having no legal settlement, or one having a legal settlement in the town where he happens to be, or in some other town of the Commonwealth. We think this provision had reference to the same considerations of humanity and pol cy, which pervade the poor laws, requiring the town where a person falls into distress and requires immediate relief, to afford that relief, without stopping to inquire whether such person has a settlement in that, or any other town, or is a stranger. In ordinary cases the relief is afforded promptly, and the question who is ultimately liable, is to be settled afterwards. If it is found, that the pauper has a settlement in the same town, that town bears the expense ; if in any other town in the State, that town must reimburse the former. If he has no settlement, the town advancing the necessary expense for relief, will look to the Commonwealth, for such reimbursement as the laws afford. We think the provision in question had reference to this state of the law, and the duties and liabilities of towns. Without this provision, the person found in a state of derangement, needy and helpless, would be relieved in the first instance, by the town where he then resides, or is actually found, without regard to his settlement. The provision in question imposes no new duty or burden upon such town, but only provides a different mode of discharging an existing one. This law provides that such town, instead of relieving such lunatic, in their own alms-house, shall pay the expense of such relief in the first instance, in the more suitable asylum and retreat afforded by the hospital, with the same remedy over for reimbursement, against persons, towns, and the Commonwealth, respectively. This gives a plain and intelligible meaning to the term “ residence,” as contra-distinguished from settlement, and designates with exactness, that town, whether of settlement or otherwise, in which the patient would, in the ordinary operation of the poor-laws, be entitled to present and immediate relief. It is there*80fore immaterial in this view, whether the lunatic has a home, or a temporary residence in such town, or is merely passing through it. For though, in common parlance, one is hardly said to “reside” in a place which he is merely passing through, yet in a statute, every provision and every word must be construed with reference to the other parts of the act. This act provides, in § 3, that the judges &c. in the several counties are authorized to commit to said hospital any lunatic, who in their opinion is so furiously mad as to render it manifestly dangerous to the peace and safety of the community that such lunatic should continue at large. The authority therefore is co-extensive with the limits of the Commonwealth, and embraces every person within it, whether strangers or others. All are equally dangerous to the community. The statute manifestly intends that some town shall have notice, and shall in the first instance be liable for the expense ; and if such person be a stranger, merely passing through the Commonwealth, such town can be no other, than that where the lunatic is found at the moment of the application. This is confirmed by the consideration, that had this Jaw not been passed, such town would have been bound by law, to provide for the relief of such stranger, and that towns are still so bound, where such stranger requires immediate relief, in consequence of sudden sickness, accident, or any cause, other than insanity.
5. There is one remaining class, consisting of persons committed to the hospital by the order or sentence of the Supreme Judicial Court, or Court of Common Pleas, pursuant to the provisions of St. 1816, c. 28, as modified by St. 1834, c. 150, since the passing of the latter act.
By the former of these statutes, where a person is brought before a court for trial of a crime, and acquitted on the ground of insanity, or not indicted, for the same reason, the court is authorized to commit such person to close custody, for the safety of the community, and in general would feel bound, under such circumstances, to exercise this authority. The necessity and propriety of such commitment would depend upon the facts disclosed on the trial, or before the grand jury, and it would be made upon the judge’s own responsibility, in *81the due administration of the law, without the application of anybody. It would seem to be an extremely forced construction to say, that a person thus committed by a court in the exercise of its criminal jurisdiction, is a commitment upon application, especially where there is another case for commitment, contemplated by the statute, which can only be upon the application of friends or other persons for that par ticular purpose ; and it would seem still more forced to consider the town where the court happens to be held, and where the prisoner is detained by force of criminal process, perhaps not bailable, as the town where such person resides, at the time of the application for his commitment to the hospital, so as to charge such town for his support there, perhaps for months or years. It has long been settled, that a town in which a gaol is situated, is not bound to furnish relief to a prisoner, there held on criminal process ; Adams v. Wiscassett, 5 Mass. R. 328 ; though it is held otherwise, in regard to prisoners detained on civil process. Cargill v. Wiscassett, 2 Mass. R. 547. But if such town is not liable, the hospital is without remedy, the trustees having no claim but upon the town of the patient’s residence.
• There is one provision, in the last clause of § 6, which, in one aspect, would seem to lead to a different construction, but which, when fully considered in its connexion, confirms the conclusion drawn from other parts of the act. It is the clause already referred to, providing that the tribunals and magistrates having power to order commitments to the hospital, shall certify the name of the town where the patient resided, at the time of the application. If these terms were necessarily to be construed distributively, u tribunals ” meaning courts of criminal jurisdiction, administering the law, and “ magistrates ” meaning judges of probate &c., it would seem to extend this provision for making a certificate of residence, to both classes of cases. But on looking back to § 4 it will appear, that the legislature did not make this distinction, but used “ tribunals ” and “ magistrates ” indiscriminately. It provides, that no tribunals, other than the judicial officers therein mentioned, shall have the power &c., thus using them as equivalent terms.
*82But that this clause cannot be intended to extend to commitments to the hospital, by courts of criminal jurisdiction on acquittal by reason of insanity, is manifest from this, that no provision is made in the act for notice to any town ; and there is no time to which the required certificate can apply. But these words must be construed with reference to the subject matter, and then the provision will be, that when any person is committed to the hospital, by any tribunal or magistrate having the authority, on application by any person representing such patient as a lunatic, the person so applying shall give notice to the town, where he then resides; the town will of course be admitted to appear and oppose the commitment, the tribunal or magistrate will then certify the fact of residence, and such certificate will be conclusive. But it would seem absurd to require a court to certify that a person before it on a trial for crime, is residing in the same town where the court is held, and yet this is all it could certify on the subject, if we are right in construing the provisions in respect to residence.
But one thing appears manifest from this provision, having a bearing upon the general question, which is this ; that “ commitment,” as used in several places in this act, means commitment to the hospital, and that the fact, and the certificate of residence, have reference to such commitment; that the application for commitment, the time of such application, and the place of residence of the lunatic, at that time, all apply to the commitment to the hospital. It can therefore have no application to the comm'tment of the lunatic to any gaol or house of correction, at any anterior period ; and of course the place of residence of such lunatic, at the time any application for his commitment, or of his actual commitment to any gaol or house of correction, previous to the application for his commitment to the hospital, is wholly immaterial, and can have no influence in fixing the liability of any town, under this statute.
From this view of the subject it follows, that in regard to all that class of persons charged with crime and acquitted on the ground of insanity, and by force of the two statutes cited, committed to the superintendent of the hospital, al*83though the former act, St. 1816, c. 28, § 1, provides, that they shall be kept at their own expense, or at the charge of the person or town liable for their maintenance, yet as the statute concerning the lunatic hospital has not transferred the right to the trustees, to charge such person or town, nor vested in the treasurer an authority to maintain an action upon the ground of such liability, no action can be maintained by the plaintiff as treasurer for the support of any such lunatic, either against the lunatic himself, or against the person or town, upon whom his maintenance would be legally chargeable.
This construction of the statute decides the present case in favor of the defendants. Both the patients, for whose support the plaintiff sues, were committed to the house of correction in Worcester, and thence removed to the hospital, prior to March 1834, when this act was passed. They were in fact both committed as lunatics by two justices quorum mus, by virtue of St. 1797, c. 62, § 3, prior to the act of March 1832, providing for the removal of such persons to the State Lunatic Hospital," and were removed conformably to the proclamation, issued under the authority of that act. But we consider the fact, that they were removed to, and were actually in the hospital, prior to March 28, 1834, the date of the last act, as decisive of the present question.
Plaintiff nonsuit.
But see Revised Stat. c. 48 ; also c. 136, § 15, and c. 137, § 12.