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

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

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

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

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

e = A("e")
i = B("i")
k = C("k")
h = D("h")
d = E("d")
n = D("n")
l = B("l")
c = C("c")

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

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

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

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

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

e = A("e")
i = B("i")
k = C("k")
h = D("h")
d = E("d")
n = D("n")
l = B("l")
c = C("c")

e.x = n
e.z = n
i.p = d
i.w = c
i.z = c
i.s = n
i.r = l
k.q = i
k.y = h
k.w = h
k.v = n
k.r = e
h.v = i
h.y = d
d.s = e
n.v = i
n.y = d
l.p = d
l.w = c
l.s = h
l.r = i
l.z = k
c.q = l
c.y = h
c.v = n
c.w = n
c.r = e
assert k.r.x.v.txt == "i"