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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.v: E = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

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

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

d = A("d")
l = B("l")
b = C("b")
c = D("c")
a = E("a")
i = F("i")
h = C("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: C = None
        self.v: E = None
        self.y: C = None
        self.p: E = None
        self.txt = txt

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

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

d = A("d")
l = B("l")
b = C("b")
c = D("c")
a = E("a")
i = F("i")
h = C("h")

d.o = i
d.z = i
d.y = a
l.q = i
l.x = i
b.z = a
b.s = i
b.p = i
b.w = i
c.o = a
c.v = a
c.p = a
c.w = b
c.y = h
a.s = l
a.v = c
i.r = b
i.z = b
i.t = a
i.v = a
h.z = a
h.s = i
h.p = i
h.w = i
assert b.w.t.v.w.z.txt == "a"