class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.v: B = None
        self.z: D = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

d = A("d")
k = B("k")
e = C("e")
m = D("m")
g = E("g")
n = F("n")

d.t = k
d.u = k
d.v = k
d.z = m
d.s = e
d.w = n
k.z = n
k.v = n
e.r = m
e.y = k
e.t = k
e.z = k
e.w = n
e.u = n
m.v = g
m.z = g
g.y = n
n.w = d
n.q = g
assert e.r.v.y.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.v: B = None
        self.z: D = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

d = A("d")
k = B("k")
e = C("e")
m = D("m")
g = E("g")
n = F("n")

d.t = k
d.u = k
d.v = k
d.z = m
d.s = e
d.w = n
k.z = n
k.v = n
e.r = m
e.y = k
e.t = k
e.z = k
e.w = n
e.u = n
m.v = g
m.z = g
g.y = n
n.w = d
n.q = g
assert e.r.v.y.w.z.txt == "m"