Concept:
Metal oxides are generally basic, while non-metal oxides are generally acidic.
Higher oxidation state and greater non-metallic character increase acidic nature.
Step 1: Identify the most basic oxide
Among the given metal oxides,
\[
\text{K}_2\text{O},\quad \text{MgO}
\]
Potassium is more electropositive than magnesium.
Hence,
\[
\text{K}_2\text{O}
\]
is the strongest basic oxide.
Step 2: Identify the most acidic oxide
Among the acidic oxides,
\[
\text{SO}_2,\quad \text{P}_2\text{O}_5,\quad \text{SO}_3
\]
Sulfur in $\text{SO}_3$ has oxidation state $+6$, which is higher than that in $\text{SO}_2$.
Also, sulfur is more electronegative than phosphorus.
Therefore,
\[
\text{SO}_3
\]
is the most acidic oxide.
Hence,
\[
\boxed{\text{SO}_3,\ \text{K}_2\text{O}}
\]