class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

m.y = i
m.r = i
m.u = i
m.z = h
k.z = n
c.q = d
c.u = d
c.v = n
j.r = g
j.v = n
j.w = d
g.x = b
g.r = h
g.o = h
g.t = k
d.q = c
d.u = c
d.v = k
i.r = g
i.v = n
i.w = c
n.z = k
b.x = g
b.r = m
b.o = m
b.t = k
h.y = j
h.r = j
h.u = j
h.z = m
assert j.r.t.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: D = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

m.y = i
m.r = i
m.u = i
m.z = h
k.z = n
c.q = d
c.u = d
c.v = n
j.r = g
j.v = n
j.w = d
g.x = b
g.r = h
g.o = h
g.t = k
d.q = c
d.u = c
d.v = k
i.r = g
i.v = n
i.w = c
n.z = k
b.x = g
b.r = m
b.o = m
b.t = k
h.y = j
h.r = j
h.u = j
h.z = m
assert j.r.t.z.z.z.z.z.z.txt == "k"