class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: H = None
        self.o: C = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: F = None
        self.z: E = None
        self.s: F = None
        self.q: A = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.z: A = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: H = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: F = None
        self.z: E = None
        self.s: F = None
        self.q: A = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: G = None
        self.z: A = None
        self.t: E = None
        self.w: G = None
        self.txt = txt

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

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