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

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.w: E = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.w: E = None
        self.t: D = None
        self.v: D = None
        self.txt = txt

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

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

n.s = i
n.r = l
n.t = e
n.x = a
n.v = c
m.x = h
m.z = h
m.r = l
m.o = i
m.p = i
l.s = m
i.p = e
i.t = e
i.v = e
i.z = m
i.w = c
c.q = h
c.x = i
e.p = i
e.t = i
e.v = i
e.z = m
e.w = h
h.q = c
h.x = i
a.s = e
a.t = e
a.r = l
a.x = n
a.v = h
assert a.v.x.w.txt == "c"