class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

i = A("i")
d = B("d")
h = C("h")
b = D("b")
n = E("n")
c = F("c")
l = E("l")

i.t = d
i.u = d
i.o = b
i.z = b
d.p = n
d.q = i
h.w = i
h.x = b
b.x = l
b.o = h
b.w = h
n.u = b
n.x = h
c.v = n
c.x = n
c.p = b
c.u = h
l.u = b
l.x = h
assert c.v.u.x.x.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

i = A("i")
d = B("d")
h = C("h")
b = D("b")
n = E("n")
c = F("c")
l = E("l")

i.t = d
i.u = d
i.o = b
i.z = b
d.p = n
d.q = i
h.w = i
h.x = b
b.x = l
b.o = h
b.w = h
n.u = b
n.x = h
c.v = n
c.x = n
c.p = b
c.u = h
l.u = b
l.x = h
assert c.v.u.x.x.w.o.txt == "b"