class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
b = B("b")
m = A("m")
i = B("i")

d.t = e
d.s = e
d.o = e
j.o = i
j.x = e
j.s = e
e.o = b
e.y = b
e.x = j
b.o = j
b.x = e
b.s = e
m.t = e
m.s = e
m.o = e
i.o = b
i.x = e
i.s = e
assert d.o.x.s.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: B = None
        self.x: B = None
        self.txt = txt

d = A("d")
j = B("j")
e = C("e")
b = B("b")
m = A("m")
i = B("i")

d.t = e
d.s = e
d.o = e
j.o = i
j.x = e
j.s = e
e.o = b
e.y = b
e.x = j
b.o = j
b.x = e
b.s = e
m.t = e
m.s = e
m.o = e
i.o = b
i.x = e
i.s = e
assert d.o.x.s.o.o.txt == "j"