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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.p: F = None
        self.t: F = None
        self.txt = txt

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

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

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

k = A("k")
d = B("d")
h = C("h")
n = D("n")
e = E("e")
b = F("b")
m = C("m")
a = C("a")

k.q = n
d.s = n
h.w = d
h.v = d
h.p = b
h.t = b
n.r = h
n.o = e
n.u = e
n.z = a
e.y = b
b.y = e
m.w = d
m.v = d
m.p = b
m.t = b
a.w = d
a.v = d
a.p = b
a.t = b
assert a.v.s.z.t.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.p: F = None
        self.t: F = None
        self.txt = txt

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

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

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

k = A("k")
d = B("d")
h = C("h")
n = D("n")
e = E("e")
b = F("b")
m = C("m")
a = C("a")

k.q = n
d.s = n
h.w = d
h.v = d
h.p = b
h.t = b
n.r = h
n.o = e
n.u = e
n.z = a
e.y = b
b.y = e
m.w = d
m.v = d
m.p = b
m.t = b
a.w = d
a.v = d
a.p = b
a.t = b
assert a.v.s.z.t.y.y.y.y.txt == "b"