Input (grade 13): Located in southwestern Europe, Portugal is the westernmost country of mainland Europe and is bordered by the Atlantic Ocean to the west and south and by Spain to the north and east.
Output (grade 4): The Atlantic Ocean is to the west and south, and Spain is to the north and east.