Rifat has to determine all positive integers that are not divisible by 10 and when their last three digits are removed, the resulting number is a perfect cube. Assuming the original integer can be represented in the form , where is a positive integer and is a digit from 1 to 9, determine the maximum possible value of .