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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: D = None
        self.txt = txt

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

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

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

k.w = l
k.u = e
k.q = n
h.o = n
h.z = l
h.q = l
h.y = i
h.s = i
g.w = l
g.o = l
l.x = a
l.p = h
l.r = g
a.z = i
i.z = a
b.w = l
b.o = l
n.o = h
n.z = l
n.q = l
n.y = i
n.s = a
e.w = l
e.u = k
e.q = h
assert b.o.x.z.z.z.z.z.txt == "i"