class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.o: F = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.y: E = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

n.w = b
c.r = e
c.w = e
c.t = b
e.v = n
e.z = n
e.o = b
e.s = b
e.p = i
i.v = n
l.z = b
l.u = i
l.o = i
l.v = i
l.y = h
b.q = n
b.p = h
b.y = c
h.z = b
h.u = i
h.o = i
h.v = i
h.y = l
assert h.y.z.p.z.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.o: F = None
        self.s: F = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.y: E = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

n.w = b
c.r = e
c.w = e
c.t = b
e.v = n
e.z = n
e.o = b
e.s = b
e.p = i
i.v = n
l.z = b
l.u = i
l.o = i
l.v = i
l.y = h
b.q = n
b.p = h
b.y = c
h.z = b
h.u = i
h.o = i
h.v = i
h.y = l
assert h.y.z.p.z.q.w.txt == "b"