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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: F = None
        self.p: D = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
k = B("k")
b = C("b")
d = D("d")
c = E("c")
f = F("f")
l = F("l")
n = B("n")
h = E("h")

e.s = c
k.z = b
k.q = b
k.v = f
k.p = d
k.y = n
b.t = d
d.z = n
c.z = f
f.v = c
l.v = c
n.z = b
n.q = b
n.v = l
n.p = d
n.y = k
h.z = l
assert n.v.v.z.v.z.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: F = None
        self.p: D = None
        self.y: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
k = B("k")
b = C("b")
d = D("d")
c = E("c")
f = F("f")
l = F("l")
n = B("n")
h = E("h")

e.s = c
k.z = b
k.q = b
k.v = f
k.p = d
k.y = n
b.t = d
d.z = n
c.z = f
f.v = c
l.v = c
n.z = b
n.q = b
n.v = l
n.p = d
n.y = k
h.z = l
assert n.v.v.z.v.z.v.z.v.txt == "c"