class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: F = None
        self.s: C = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.q: B = None
        self.w: B = None
        self.t: E = None
        self.txt = txt

d = A("d")
i = B("i")
b = C("b")
n = D("n")
k = E("k")
c = F("c")

d.t = c
d.r = c
d.q = c
d.s = b
d.u = k
i.q = d
i.r = c
b.u = c
b.y = c
b.p = c
n.z = d
n.v = i
k.s = n
k.w = c
c.z = b
c.y = k
c.t = k
c.q = i
c.w = i
assert d.u.w.z.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: F = None
        self.s: C = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.q: B = None
        self.w: B = None
        self.t: E = None
        self.txt = txt

d = A("d")
i = B("i")
b = C("b")
n = D("n")
k = E("k")
c = F("c")

d.t = c
d.r = c
d.q = c
d.s = b
d.u = k
i.q = d
i.r = c
b.u = c
b.y = c
b.p = c
n.z = d
n.v = i
k.s = n
k.w = c
c.z = b
c.y = k
c.t = k
c.q = i
c.w = i
assert d.u.w.z.u.t.w.txt == "c"