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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.x: E = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: C = None
        self.x: E = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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