system: You are a text-to-SQL generator. Given a database schema and a question, reply with a single valid SQLite query that answers it. Output only the SQL on one line, with no explanation and no markdown.

user: Schema:
CREATE TABLE institution_details (
  unitid integer PRIMARY KEY,
  chronname text,
  city text,
  state text,
  level text,
  control text,
  basic text,
  hbcu text,
  flagship text,
  long_x real,
  lat_y real,
  site text,
  student_count integer,
  awards_per_value real,
  awards_per_state_value real,
  awards_per_natl_value real,
  exp_award_value integer,
  exp_award_state_value integer,
  exp_award_natl_value integer,
  exp_award_percentile integer,
  ft_pct real,
  fte_value integer,
  fte_percentile integer,
  med_sat_value text,
  med_sat_percentile text,
  aid_value integer,
  aid_percentile integer,
  endow_value text,
  endow_percentile text,
  grad_100_value real,
  grad_100_percentile integer,
  grad_150_value real,
  grad_150_percentile integer,
  pell_value real,
  pell_percentile integer,
  retain_value real,
  retain_percentile integer,
  ft_fac_value real,
  ft_fac_percentile integer,
  vsa_year text,
  vsa_grad_after4_first text,
  vsa_grad_elsewhere_after4_first text,
  vsa_enroll_after4_first text,
  vsa_enroll_elsewhere_after4_first text,
  vsa_grad_after6_first text,
  vsa_grad_elsewhere_after6_first text,
  vsa_enroll_after6_first text,
  vsa_enroll_elsewhere_after6_first text,
  vsa_grad_after4_transfer text,
  vsa_grad_elsewhere_after4_transfer text,
  vsa_enroll_after4_transfer text,
  vsa_enroll_elsewhere_after4_transfer text,
  vsa_grad_after6_transfer text,
  vsa_grad_elsewhere_after6_transfer text,
  vsa_enroll_after6_transfer text,
  vsa_enroll_elsewhere_after6_transfer text,
  similar text,
  state_sector_ct integer,
  carnegie_ct integer,
  counted_pct text,
  nicknames text,
  cohort_size integer
);
CREATE TABLE institution_grads (
  unitid integer,
  year integer,
  gender text,
  race text,
  cohort text,
  grad_cohort text,
  grad_100 text,
  grad_150 text,
  grad_100_rate text,
  grad_150_rate text
);
CREATE TABLE state_sector_grads (
  stateid integer,
  state text,
  state_abbr text,
  control text,
  level text,
  year integer,
  gender text,
  race text,
  cohort text,
  grad_cohort text,
  grad_100 text,
  grad_150 text,
  grad_100_rate text,
  grad_150_rate text,
  grad_cohort_ct integer
);
CREATE TABLE state_sector_details (
  stateid integer PRIMARY KEY,
  state text,
  state_post text,
  level text PRIMARY KEY,
  control text PRIMARY KEY,
  schools_count integer,
  counted_pct text,
  awards_per_state_value text,
  awards_per_natl_value real,
  exp_award_state_value text,
  exp_award_natl_value integer,
  state_appr_value text,
  state_appr_rank text,
  grad_rate_rank text,
  awards_per_rank text
);
-- foreign keys: institution_grads.unitid -> institution_details.unitid; state_sector_grads.stateid -> state_sector_details.stateid; state_sector_grads.state -> institution_details.state; state_sector_details.state -> institution_details.state

Hint: highest state appropriations to higher education in fiscal year 2011 per resident refers to MAX(state_appr_value); lowest number of undergraduates refers to MIN(student_count); in 2010 refers to year = 2010;

Question: In the state with the highest state appropriations to higher education in fiscal year 2011 per resident, which institution has the lowest number of undergraduates in 2010?

assistant: SELECT T1.chronname FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T1.student_count = ( SELECT MIN(T1.student_count) FROM institution_details AS T1 INNER JOIN state_sector_details AS T2 ON T2.state = T1.state INNER JOIN institution_grads AS T3 ON T3.unitid = T1.unitid WHERE T3.year = 2010 ) AND T3.year = 2010 GROUP BY T1.state ORDER BY SUM(T2.state_appr_value) DESC LIMIT 1