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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.t: D = None
        self.r: D = None
        self.u: A = None
        self.txt = txt

g = A("g")
h = B("h")
k = C("k")
m = D("m")
f = E("f")
j = C("j")
e = A("e")
i = B("i")

g.w = i
g.z = h
h.w = j
h.y = m
h.u = m
h.z = k
h.x = g
k.v = h
k.u = g
k.o = j
k.q = i
m.p = g
f.s = k
f.o = j
f.t = m
f.r = m
f.u = g
j.v = h
j.u = g
j.o = k
j.q = i
e.w = h
e.z = h
i.w = j
i.y = m
i.u = m
i.z = k
i.x = e
assert k.u.z.w.u.w.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.t: D = None
        self.r: D = None
        self.u: A = None
        self.txt = txt

g = A("g")
h = B("h")
k = C("k")
m = D("m")
f = E("f")
j = C("j")
e = A("e")
i = B("i")

g.w = i
g.z = h
h.w = j
h.y = m
h.u = m
h.z = k
h.x = g
k.v = h
k.u = g
k.o = j
k.q = i
m.p = g
f.s = k
f.o = j
f.t = m
f.r = m
f.u = g
j.v = h
j.u = g
j.o = k
j.q = i
e.w = h
e.z = h
i.w = j
i.y = m
i.u = m
i.z = k
i.x = e
assert k.u.z.w.u.w.w.u.txt == "g"