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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: A = None
        self.q: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: A = None
        self.q: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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