class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: E = None
        self.s: B = None
        self.r: D = 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.y: E = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

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

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

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

j.t = l
j.p = c
j.s = d
j.r = i
b.q = j
m.y = n
m.t = j
m.r = j
g.x = i
g.p = i
g.r = d
g.t = c
g.w = m
c.v = b
c.z = i
l.x = g
l.r = b
l.t = c
l.w = m
l.p = h
h.x = l
h.r = b
h.t = n
h.w = m
h.p = g
d.q = j
i.x = g
i.p = g
i.r = b
i.t = c
i.w = m
n.v = b
n.z = i
assert l.w.y.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: E = None
        self.s: B = None
        self.r: D = 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.y: E = None
        self.t: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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