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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.r: C = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

k = A("k")
c = B("c")
f = C("f")
i = D("i")
g = E("g")
e = F("e")
d = E("d")

k.y = e
k.t = c
k.s = i
c.x = e
f.y = d
f.o = i
f.q = i
f.s = e
i.t = c
g.s = c
g.z = f
e.v = f
e.r = f
e.q = i
e.p = i
e.w = i
d.s = c
d.z = f
assert k.t.x.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: D = None
        self.q: D = None
        self.s: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.r: C = None
        self.p: D = None
        self.w: D = None
        self.txt = txt

k = A("k")
c = B("c")
f = C("f")
i = D("i")
g = E("g")
e = F("e")
d = E("d")

k.y = e
k.t = c
k.s = i
c.x = e
f.y = d
f.o = i
f.q = i
f.s = e
i.t = c
g.s = c
g.z = f
e.v = f
e.r = f
e.q = i
e.p = i
e.w = i
d.s = c
d.z = f
assert k.t.x.w.t.txt == "c"