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

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

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

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

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

g = A("g")
c = B("c")
m = C("m")
n = D("n")
e = E("e")
h = B("h")

g.t = c
c.r = g
c.p = g
c.u = g
c.s = h
c.t = m
m.t = n
n.z = c
n.p = h
n.v = h
n.q = m
e.z = h
h.r = g
h.p = g
h.u = g
h.s = c
h.t = m
assert c.s.s.s.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

g = A("g")
c = B("c")
m = C("m")
n = D("n")
e = E("e")
h = B("h")

g.t = c
c.r = g
c.p = g
c.u = g
c.s = h
c.t = m
m.t = n
n.z = c
n.p = h
n.v = h
n.q = m
e.z = h
h.r = g
h.p = g
h.u = g
h.s = c
h.t = m
assert c.s.s.s.u.t.txt == "c"