The German president visited Warsaw to mark the 30th anniversary of a treaty between the two countries.