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

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

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

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

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

g = A("g")
m = B("m")
a = C("a")
n = D("n")
e = E("e")
j = C("j")
k = D("k")

g.o = e
g.s = e
g.z = m
m.r = j
m.o = n
m.s = e
m.x = g
a.x = e
a.q = e
a.o = k
n.v = k
n.q = k
n.z = e
e.v = k
e.r = m
j.x = e
j.q = e
j.o = n
k.v = n
k.q = n
k.z = e
assert j.q.r.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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

g = A("g")
m = B("m")
a = C("a")
n = D("n")
e = E("e")
j = C("j")
k = D("k")

g.o = e
g.s = e
g.z = m
m.r = j
m.o = n
m.s = e
m.x = g
a.x = e
a.q = e
a.o = k
n.v = k
n.q = k
n.z = e
e.v = k
e.r = m
j.x = e
j.q = e
j.o = n
k.v = n
k.q = n
k.z = e
assert j.q.r.x.s.txt == "e"