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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

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

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