The first one is the only method that gets the memory management correct. The second one leaks two and the third one three NSString instances. If you don't get the string "A1A2A3" from the first method the error is somewhere outside that method.
For every retain message you send you also have to send a release or autorelease message in the same method, unless your method name starts with alloc or copy. In that case the caller needs to release the returned object.