human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Class, GNRI No., Name, BP serial No., Rebuilt, 1958, Withdrawn
###Question: What is the smallest withdrawn value with a GNRI greater than 172, name of Croagh Patrick and was rebuilt before 1939?
gpt
SELECT MIN Withdrawn FROM table WHERE GNRI No. > 172 AND Name = croagh patrick AND Rebuilt < 1939