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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

e = A("e")
g = B("g")
m = C("m")
j = D("j")
l = E("l")
b = C("b")
h = A("h")

e.x = h
g.q = l
g.w = b
g.y = b
g.s = e
m.t = l
j.p = l
j.u = l
j.w = g
l.v = g
l.y = g
l.q = b
l.z = b
b.t = l
h.x = e
assert m.t.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: C = None
        self.s: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: E = None
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: C = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

e = A("e")
g = B("g")
m = C("m")
j = D("j")
l = E("l")
b = C("b")
h = A("h")

e.x = h
g.q = l
g.w = b
g.y = b
g.s = e
m.t = l
j.p = l
j.u = l
j.w = g
l.v = g
l.y = g
l.q = b
l.z = b
b.t = l
h.x = e
assert m.t.v.q.txt == "l"