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

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

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

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

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

n = A("n")
d = B("d")
l = C("l")
g = D("g")
j = E("j")
m = C("m")
f = A("f")
c = B("c")

n.t = g
d.t = g
d.v = j
l.z = m
l.r = f
l.w = f
l.v = d
l.u = j
g.s = c
g.r = j
j.y = n
j.q = m
j.s = d
j.x = d
j.p = g
m.z = l
m.r = n
m.w = n
m.v = d
m.u = j
f.t = g
c.t = g
c.v = j
assert m.u.y.t.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

n = A("n")
d = B("d")
l = C("l")
g = D("g")
j = E("j")
m = C("m")
f = A("f")
c = B("c")

n.t = g
d.t = g
d.v = j
l.z = m
l.r = f
l.w = f
l.v = d
l.u = j
g.s = c
g.r = j
j.y = n
j.q = m
j.s = d
j.x = d
j.p = g
m.z = l
m.r = n
m.w = n
m.v = d
m.u = j
f.t = g
c.t = g
c.v = j
assert m.u.y.t.s.t.txt == "g"