Generate train ID