class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: C = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

f.o = j
f.p = j
f.s = j
f.y = d
f.u = h
h.o = j
h.w = d
h.z = g
h.x = n
b.w = c
b.p = n
b.r = i
b.v = j
b.z = k
k.o = g
i.s = g
g.o = k
n.s = g
c.o = j
c.s = j
c.p = b
c.y = d
c.u = h
d.o = j
d.w = h
d.z = g
d.x = n
j.w = c
j.p = i
j.r = n
j.v = b
j.z = g
assert k.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: C = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

f.o = j
f.p = j
f.s = j
f.y = d
f.u = h
h.o = j
h.w = d
h.z = g
h.x = n
b.w = c
b.p = n
b.r = i
b.v = j
b.z = k
k.o = g
i.s = g
g.o = k
n.s = g
c.o = j
c.s = j
c.p = b
c.y = d
c.u = h
d.o = j
d.w = h
d.z = g
d.x = n
j.w = c
j.p = i
j.r = n
j.v = b
j.z = g
assert k.o.o.o.o.o.txt == "g"