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

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

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

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

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

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

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

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

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

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

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

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

n.s = a
n.v = a
h.x = d
h.r = n
h.u = m
h.s = a
h.q = i
c.y = a
k.o = h
k.z = h
k.r = a
k.p = d
a.s = m
a.p = m
a.q = n
a.t = i
d.o = h
d.z = h
d.r = a
d.p = k
m.o = h
m.z = h
m.r = a
m.p = d
b.y = a
i.s = a
i.v = a
assert i.s.q.s.txt == "a"