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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.t: F = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
l = C("l")
f = D("f")
a = E("a")
c = F("c")
i = E("i")
b = F("b")
g = C("g")

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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.t: F = None
        self.txt = txt

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

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

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

k = A("k")
n = B("n")
l = C("l")
f = D("f")
a = E("a")
c = F("c")
i = E("i")
b = F("b")
g = C("g")

k.q = f
k.r = f
k.o = f
k.p = f
k.w = f
n.x = l
l.z = g
l.u = n
l.t = b
f.u = l
a.q = f
a.x = b
a.o = n
a.z = i
a.u = l
c.z = f
i.q = f
i.x = c
i.o = n
i.z = a
i.u = l
b.z = f
g.z = l
g.u = n
g.t = c
assert b.z.u.z.z.txt == "l"