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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
l = C("l")
b = D("b")
m = E("m")
g = D("g")
i = E("i")
d = B("d")
c = E("c")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.q: D = None
        self.z: A = None
        self.txt = txt

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

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

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

e = A("e")
h = B("h")
l = C("l")
b = D("b")
m = E("m")
g = D("g")
i = E("i")
d = B("d")
c = E("c")

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