class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.o: E = None
        self.v: B = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.q: A = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

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

b.u = l
b.y = g
b.z = g
i.z = h
i.s = l
h.r = b
h.y = b
h.z = i
h.v = i
h.t = i
h.o = d
g.r = i
g.u = i
g.p = h
g.q = b
g.s = b
d.o = h
d.x = h
d.u = g
d.v = i
l.y = i
l.x = i
l.w = h
assert h.t.s.x.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: B = None
        self.o: E = None
        self.v: B = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: C = None
        self.q: A = None
        self.s: A = None
        self.u: B = None
        self.txt = txt

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

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

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

b.u = l
b.y = g
b.z = g
i.z = h
i.s = l
h.r = b
h.y = b
h.z = i
h.v = i
h.t = i
h.o = d
g.r = i
g.u = i
g.p = h
g.q = b
g.s = b
d.o = h
d.x = h
d.u = g
d.v = i
l.y = i
l.x = i
l.w = h
assert h.t.s.x.z.o.txt == "d"