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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: A = None
        self.t: E = None
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

c.s = n
c.p = a
l.q = c
h.s = c
h.t = c
e.o = n
e.t = n
e.u = n
e.v = c
e.z = h
n.w = a
n.u = l
n.q = h
k.w = c
k.u = l
k.q = h
a.s = k
a.p = c
assert l.q.s.w.p.s.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: A = None
        self.t: E = None
        self.z: C = None
        self.u: E = None
        self.txt = txt

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

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

c.s = n
c.p = a
l.q = c
h.s = c
h.t = c
e.o = n
e.t = n
e.u = n
e.v = c
e.z = h
n.w = a
n.u = l
n.q = h
k.w = c
k.u = l
k.q = h
a.s = k
a.p = c
assert l.q.s.w.p.s.q.t.txt == "c"