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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.y: D = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

l = A("l")
g = B("g")
h = C("h")
i = D("i")
c = E("c")
b = E("b")
e = E("e")
n = A("n")

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: A = None
        self.y: D = None
        self.r: B = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

l = A("l")
g = B("g")
h = C("h")
i = D("i")
c = E("c")
b = E("b")
e = E("e")
n = A("n")

l.u = g
g.t = h
g.w = h
g.y = h
g.u = l
h.w = e
h.p = n
h.y = i
h.r = g
h.v = c
i.x = h
i.q = n
c.q = h
c.z = h
c.s = g
c.y = i
b.q = h
b.z = h
b.s = g
b.y = i
e.q = h
e.z = h
e.s = g
e.y = i
n.u = g
assert e.y.q.u.u.u.txt == "g"