Thousands flee flood-hit parts of Germany and Hungary