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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.y: A = None
        self.r: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.y: A = None
        self.r: D = None
        self.z: B = None
        self.txt = txt

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

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