#import <Foundation/Foundation.h>

@interface BankAccount : NSObject
@property (copy) NSString *name;
@property (copy) NSDecimalNumber *balance;
- (id)initWithName:(NSString *)name;
- (id)initWithBalance:(NSDecimalNumber *)balance;
- (id)initWithName:(NSString *)name balance:(NSDecimalNumber *)balance NS_DESIGNATED_INITIALIZER;
@end

@implementation BankAccount

- (id)initWithName:(NSString *)name {
    return [self initWithName:name balance:[NSDecimalNumber zero]];
}

- (id)initWithName:(NSString *)name balance:(NSDecimalNumber *)balance {
    if ((self = [super init])) {
        self.name = name;
        self.balance = balance;
    }
    return self;
}

- (id)initWithBalance:(NSDecimalNumber *)balance {
    return [self initWithName:NSLocalizedString(@"Anonymous", nil) balance:balance];
}

@end

@interface JointBankAccount : BankAccount
@property (strong) NSMutableArray *coOwners;
- (id)initWithPrimaryName:(NSString *)name balance:(NSDecimalNumber *)balance coOwners:(NSArray *)coOwners NS_DESIGNATED_INITIALIZER;
@end

@implementation JointBankAccount

- (id)initWithName:(NSString *)name balance:(NSDecimalNumber *)balance {
    return [self initWithPrimaryName:name balance:balance coOwners:@[]];
}

- (id)initWithPrimaryName:(NSString *)name balance:(NSDecimalNumber *)balance coOwners:(NSArray *)coOwners {
    if ((self = [super initWithName:name balance:balance])) {
        self.coOwners = [coOwners mutableCopy];
    }
    return self;
}

@end

int main(int argc, char *argv[]) {
    @autoreleasepool {
        
    }
}