
542 N.W.2d 748 (1996)
Gordon O. ALLEN, Petitioner and Appellee,
v.
Henry C. "Bud" WESSMAN, Executive Director, State of North Dakota, Department of Human Services, Stark County Social Service Board, Respondents and Appellants.
Civil No. 950174.
Supreme Court of North Dakota.
January 30, 1996.
*749 Gerald D. Galloway (argued), Howe, Hardy, Galloway & Maus, PC, Dickinson, for petitioner and appellee.
Jean R. Mullen (argued), Assistant Attorney General, Attorney General's Office, Bismarck, for respondents and appellants.
*750 MESCHKE, Justice.
Henry C. "Bud" Wessman, Executive Director, State of North Dakota, Department of Human Services, and Stark County Social Service Board [hereinafter, collectively, the Department] appealed a district court order reversing the Department's denial of Medicaid benefits to Gordon O. Allen. We reverse and remand for entry of a judgment affirming the Department's decision because Allen's available assets in his Trust exceed the limit to receive Medicaid benefits.
In 1991 Allen established and funded a trust with his assets worth $137,000. Allen named himself and Roger A. Stone as trustees. Allen made the Trust irrevocable and specifically waived any right "to alter, amend, revoke, or terminate the trust, or any of the terms of this agreement in whole or in part." Allen's Trust also directed:
2. DISTRIBUTION PROVISIONS:
(a) During the life of the Settlor, the Trustees shall pay the net income, at least quarterly, to the Settlor, or to or for the benefit of such persons or organizations, in such amounts as the Trustee deems necessary for the maintenance and support of the Settlor.
(b) Upon the death of the Settlor, except to the extent paid from other sources, the Trustee shall pay any undistributed income to the beneficiaries described in paragraph (c) hereafter.
(c) Upon the death of the Settlor and payment of the above items, the Trust shall terminate and the Trustee shall distribute the principal and undistributed income to the following individuals in the following amounts in the following order:
(1) The sum of $2,000.00 to Settlor's cousin, Mary Louise Falkenhagen;
(2) The sum of $2,000.00 to Settlor's cousin, Norma Dahl;
(3) Of the rest and residue and remainder of the Trust of whatever nature, a 30% share to be distributed to Settlor's nephew, Jeffrey Stone, and a 70% share to Settlor's nephew, Roger A. Stone.
* * *
14. DISCRETIONARY TERMINATION OF TRUST: If the Trustees determine that continuation of this trust is contrary to the best interests of the beneficiaries or any one of them by reason of (1) legislation, or (2) because the value of the trusts assets are at such a level, in the sole judgment of the Trustees, as to make continued administration thereof financially burdensome and uneconomical, then the Trustees, in their sole discretion, may terminate such trust or separate share and distribute the principal thereof, together with undistributed income, as described in paragraph 2 of this trust.
Allen began living in a nursing home on September 9, 1993. In January 1994, the Trust agreement was submitted to the Department for a determination of availability of assets. The Department determined that the trustees had discretion to terminate the Trust, the Trust was a Medicaid qualifying trust, and the Trust assets were available for Allen's care.
On April 6, 1994, Allen's attorney petitioned the Stark County Court for appointment of a conservator for Allen and for a declaration of "the maximum amount Gordon O. Allen is entitled to under the trust." The Department was not made a party to this proceeding. Allen's attorney contended in his brief that if "the trust terminates prior to the death of Mr. Allen ... the principal is to be distributed to Mr. Allen."
Roger A. Stone, Trustee, responded to Allen's petition, contending that Trust Paragraph 14 gave the trustees authority to terminate the Trust only if "the law has substantially changed since the creation of the Trust, or the value of the Trust is such that the intentions of the Settlor are defeated" and, if the Trust was terminated, the Trust assets would not be distributed to Allen, but to the other beneficiaries. Stone insisted in his affidavit that Allen's intention was "that his assets be held in a manner that would allow him to enjoy the income therefrom for his care and support and maintenance as long as he lived," while preserving "the principal of those assets for his cousins, Mary Louise Falkenhagen, Norma[ ] Dahl, and his nephews, Jeffrey Stone and the affiant, Roger A. Stone."
*751 The county court appointed a Special Conservator for Allen, and the Special Conservator recommended that Allen's best interests would be served by a determination that Allen "is only entitled to the income derived from trust assets during his lifetime" and, "further recommended that the principal trust assets remain in the trust" until distribution upon Allen's death.
The county court decided on May 6, 1994, that Allen could never receive any of the Trust principal because the trustees may terminate the Trust during Allen's lifetime only if there is a substantial change in legislation, or if the Trust assets fall to a level that makes the trust uneconomical or burdensome to continue. The court further ruled that, if the Trust should ever be terminated under Trust Paragraph 14, any undistributed income and the principal of the Trust is not available for Allen, but must be distributed to the other beneficiaries.
On May 26, 1994, Roger A. Stone applied for Medicaid benefits for Allen. The Stark County Social Services Board denied the application on the ground that, under the Trust agreement, Allen had $136,414.69 available to him to defray medical expenses.
On appeal, an independent hearing officer found:
The Allen Trust is a Medicaid Qualifying Trust and must be taken into consideration in determining Allen's Medicaid eligibility. The full amount of the Allen Trust assets are available to Allen for purposes of Medicaid eligibility under the Medicaid laws and DHS rules adopted to implement Medicaid in North Dakota.... The trustees are permitted to exercise discretion with respect to distributions to Allen and with respect to termination. Upon termination of the trust, the only person who can receive any distribution prior to the death of Allen is Allen. The trustees have the discretion to make the full amount of the trust available to Allen by termination of the trust and, therefore, under the statutory requirements, the full amount of the trust must be taken into consideration in determining the available assets of Allen for purposes of Medicaid eligibility.
The hearing officer ruled that the county court's judgment had no weight in determining Medicaid eligibility that is governed by federal law. The hearing officer further found that Allen's intent to preserve his assets for other beneficiaries did not override federal law. The hearing officer recommended an order declaring that the Trust "falls within the definition of a Medicaid Qualifying Trust and the full amount of the trust must be counted as an available asset in determining Allen's eligibility for Medicaid benefits." The Department adopted the hearing officer's findings and affirmed the Stark County Social Service Board's denial of benefits.
When Allen appealed, the district court reversed the Department's decision. The district court ruled that the trustees do not have discretion to terminate the Trust at this time; upon termination of the Trust, the assets must be distributed to beneficiaries other than Allen; and "[t]he principal of the Trust cannot be considered as available to Allen under the terms of the Trust." The Department appealed.
On appeal from a district court judgment reviewing an administrative agency decision, we review the agency decision, and not that of the district court; we limit our review to the record before the agency, without deferring to the district court's findings; and the interpretation of a statute is a question of law that is fully reviewable by this court. Koch Oil Co. v. Hanson, 536 N.W.2d 702 (N.D.1995). Those principles guide our review and decision in this case.
The Department relies upon 42 U.S.C. § 1396a(k) (1992):[1]
Treatment of potential payments from medicaid qualifying trusts *752 (1) In the case of a medicaid qualifying trust (described in paragraph (2)), the amounts from the trust deemed available to a grantor ... is the maximum amount of payments that may be permitted under the terms of the trust to be distributed to the grantor, assuming the full exercise of discretion by the trustee or trustees for the distribution of the maximum amount to the grantor. For purposes of the previous sentence, the term "grantor" means the individual referred to in paragraph (2).

(2) For purposes of this subsection, a "medicaid qualifying trust" is a trust, or similar legal device, established (other than by will) by an individual (or an individual's spouse) under which the individual may be the beneficiary of all or part of the payments from the trust and the distribution of such payments is determined by one or more trustees who are permitted to exercise any discretion with respect to the distribution to the individual.
(3) This subsection shall apply without regard to

(A) Whether or not the medicaid qualifying trust is irrevocable or is established for purposes other than to enable a grantor to qualify for medical assistance under this subchapter; or
(B) Whether or not the discretion described in paragraph (2) is actually exercised.

(4) The State may waive the application of this subsection with respect to an individual where the State determines that such application would work an undue hardship.
Under this congressional directive for Medicaid eligibility, trust assets are "deemed available" when a trustee has any discretion to distribute them to the settlor despite the purpose of the trust, its irrevocability, or the actual exercise of discretion.
Allen contends the hearing record does not support the Department's findings that (1) the Allen Trust is a Medicaid qualifying trust, (2) the trustees have discretion about terminating the Trust, and (3), upon termination of the Trust before Allen's death, only Allen can receive a distribution. Allen contends that the hearing officer and Department were required to consider extrinsic evidence about his intent and were bound by the county court's findings interpreting the Trust. Allen urges that his intent to preserve the Trust assets for family members is not against public policy. On the other hand, the Department takes the position that extrinsic evidence and the county court decision are irrelevant and contrary to federal law for the Medicaid program.
Medicaid is a cooperative federal-state program to furnish financial assistance to needy persons for their medically necessary care. Hecker v. Stark County Soc. Serv. Bd., 527 N.W.2d 226, 233 (N.D.1994); Striegel v. South Dakota Dep't of Social Servs., 515 N.W.2d 245, 246 (S.D.1994). Wagner v. Sheridan County Soc. Servs. Bd., 518 N.W.2d 724 (N.D.1994), clarifies that an applicant for Medicaid benefits must prove eligibility.
"`Medicaid is intended to be the payer of last resort, that is, other available resources must be used before Medicaid pays for the care of an individual enrolled in the Medicaid program.'" New York State Dep't of Social Servs. v. Bowen, 846 F.2d 129, 133 (2nd Cir.1988)(quoting S.Rep. No. 146, 99th Cong., 2d Sess. 1, 312, reprinted in 1986 Code Cong. & Admin. News 42, 279). A Medicaid qualifying trust is "a trust that is deemed to have been created in order to qualify for Medicaid benefits and, for policy reasons, is considered an available asset to an applicant." Forsyth v. Rowe, 226 Conn. 818, 629 A.2d 379, 381 n. 1 (1993). Gulick v. Department of Health & Rehabilitative Servs., 615 So.2d 192, 196 (Fla.App.1993), explains that the statutory definition of a Medicaid qualifying trust in 42 U.S.C. § 1396a(k) (1992) "does not require that a trustee have unbridled discretion, but indicates that any discretion to distribute assets is sufficient."
Allen settled the Trust with his own assets, made himself a beneficiary, and gave the trustees discretion to terminate the Trust before his death and to distribute the Trust assets if continuation is contrary to the best interests of any beneficiary, including Allen, "by reason of" (1) legislation, or (2) uneconomical administration. Under Trust Paragraph *753 14, if Allen needs long term care that he is unable to pay for with his Trust income or otherwise, and federal legislation makes him ineligible for Medicaid benefits to pay for the needed care, "continuation of this trust is contrary to the best interests of" Allen "by reason of ... legislation." Under Trust Paragraph 14, "then the Trustees, in their sole discretion, may terminate such trust," and the Trust assets are available for Allen's care. Federal law declares in 42 U.S.C. § 1396a(k) (1992) that Allen's Trust is thus a Medicaid qualifying trust.
Allen contends that, if the Trust is terminated under Trust Paragraph 14, the principal must be distributed as Paragraph 2 directs to the four beneficiaries other than Allen. We disagree. Trust Paragraph 2 only directs how the trustees must distribute Trust income during Allen's life and how all assets must be distributed after Allen's death. It does not direct how Trust assets must be distributed if the trustees exercise their discretion to terminate the Trust during Allen's life.
If a trust fails and the settlor made no provision for distribution, the trustee must restore the trust property to the settlor. V William F. Fratcher, Scott on Trusts § 411 (1989). "The cases are so numerous and the rule is so well settled that it is unnecessary to cite them." Id. at n. 1 (citations to typical cases omitted). If a trust is terminated by exercise of a trustee's discretion, and the settlor has not specified "who shall receive the trust property on the termination of the trust, the trustee will ordinarily hold the trust property upon a resulting trust for the settlor or his successors in interest." IV William F. Fratcher, Scott on Trusts § 345.3, p. 555 (1989). Because Allen did not specify who should receive the Trust property if the trustees exercised their discretionary power to terminate the Trust during his life, they would then hold the property for Allen. Thus, applying 42 U.S.C. § 1396a(k)(1) (1992), all of the Trust assets are "deemed available" to Allen. Furthermore, applying 42 U.S.C. § 1396a(k)(3)(B) (1992), even if the trustees do not actually exercise their discretion to terminate the Trust during Allen's lifetime, the Trust assets are "deemed available" to Allen.
The Department ruled that both Allen's intent to preserve his assets for relatives and the county court's construction of the Trust were irrelevant to Allen's eligibility for Medicaid benefits. These rulings by the Department correctly applied the federal law. As Bleazard v. Utah Dep't of Health, 861 P.2d 1048, 1050 (Utah App.1993), explained, "State Medicaid plans must comply with federal requirements, including those regarding eligibility."
Allen's reliance on the precedential effect of Hecker v. Stark County Soc. Serv. Bd., 527 N.W.2d 226 (N.D.1994), is misplaced. Hecker did not decide the availability of a settlor-funded trust for his own benefit. The trust in Hecker was set up and funded by a person other than the Medicaid applicant. Hecker simply recognized that a trust established by someone other than the applicant, or the applicant's spouse, cannot be a Medicaid qualifying trust. Id. at 234. Allen's reliance on regulations about disqualifying transfers is also misplaced, because this self-funded Trust gives the trustees continuing discretion to terminate it and to hold the assets for Allen's benefit at any time before his death.
In the county court proceeding to construe the Trust, Trustee Roger A. Stone testified by affidavit that Allen's intention was "that his assets be held in a manner that would allow him to enjoy the income therefrom for his care and support and maintenance as long as he lived, but he wanted to preserve the principal of those assets for his cousins, Mary Louise Falkenhagen, Norma[ ] Dahl, and his nephews, Jeffrey Stone and the affiant, Roger A. Stone." If this indicated intent is actually carried out, Allen will have transferred his considerable wealth to two cousins and two nephews, and will have largely shifted the cost of his medical care to the public and taxpayers. This intent is against public policy.
Public policy will not allow the social safety net for persons who are old, poor, and unfortunate to be exploited by those who are affluent.

*754 Our conclusion reflects the legislative concern that the Medicaid program not be used as an estate planning tool. The Medicaid program would be at fiscal risk if individuals were permitted to preserve assets for their heirs while receiving Medicaid benefits from the state. Congress enacted the Medicaid qualifying trust provision as an addition to the "provisions designed to assure that individuals receiving nursing home and other long-term care services under Medicaid are in fact poor and have not transferred assets that should be used to purchase the needed services before Medicaid benefits are made available." H. Rep. No. 99-265, 99th Cong., 1st Sess. 71 (1985).
* * *
To permit Gregory to collect Medicaid benefits from the taxpayers when $195,000 of his assets are sheltered in a trust, all of which could potentially go to his heirs, would violate the spirit and intent of the Medicaid program.
Forsyth v. Rowe, 629 A.2d at 385-86. "The Medicaid program is not to be used as an estate planning tool." Striegel v. South Dakota Dep't of Social Servs., 515 N.W.2d at 247. "To permit William to receive Medicaid benefits while tens of thousands of dollars are sheltered in a trust violates the spirit and intent of the Medicaid program and is unjust to those who do not have access to supplemental funds yet desperately need the benefits." Id. at 248. See NDCC 1-02-39 (the object of a statute is an aid to interpreting statutory intent). To permit Allen to exploit Medicaid benefits while sheltering his wealth to eventually benefit his relatives violates the Medicaid program's objective.
Congress recently addressed trusts and Medicaid eligibility again in the Omnibus Budget Reconciliation Act of 1993 (Pub.L. No. 103-66, 107 Stat. 312)[OBRA].
Under OBRA `93, as borne out by each of the component House and Senate bills that contributed to the Conference Agreement, Congress identified "trusts" as the single most offensive Medicaid estate planning vehicle and tried, in almost every manner short of criminalization, to inhibit their use.
Ira Stewart Wiesner, OBRA `93 and Medicaid: Asset Transfers, Trust Availability, and Estate Recovery Statutory Analysis in Context, 19 Nova L.Rev. 679, 703 (1995). While the 1993 revisions do not directly control this case, they illuminate our path of decision and substantiate our conclusion that the letter and spirit of the Medicaid Act would be violated if we approved Medicaid benefits for Allen's nursing home care while allowing Allen to shelter his wealth for eventual distribution to his relatives.
We conclude that Allen's Trust is a Medicaid qualifying trust and that all of the Trust assets are deemed available to him for purposes of determining his eligibility for Medicaid benefits. We reverse the district court order and remand for entry of a judgment affirming the Department's decision denying Medicaid benefits to Allen while Trust assets are available for his care.
LEVINE and NEUMANN, JJ., concur.
VANDE WALLE, Chief Justice, concurring in result.
I agree that Allen's intention is against public policy. Although the majority opinion distinguishes Hecker v. Stark County Soc. Serv. Bd., 527 N.W.2d 226 (N.D.1994), I continue to believe the trustor's intent in that case was contrary to public policy. Hecker, supra at 236 (VandeWalle, C.J., dissenting).
SANDSTROM, J., concurs.
NOTES
[1]  Public Law 103-66, Title XIII, § 13611(d)(1)(C), Aug. 10, 1993, 107 Stat. 626-27, repealed, replaced, and expanded 42 U.S.C. § 1396a(k), but the repeal, replacement, and expansion does not apply to trusts established on or before August 10, 1993. See Public Law 103-66, Title XIII, § 13611(e)(2)(C). See 42 U.S.C. § 1396p(d) for the replacement provisions.
