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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
k = C("k")
b = D("b")
a = E("a")
e = F("e")

m.v = k
m.t = k
m.z = b
c.u = a
k.p = c
k.w = m
k.z = e
b.x = c
b.w = e
b.z = k
b.t = k
b.q = k
b.v = m
a.p = k
e.y = m
e.u = b
e.r = c
e.z = k
assert k.p.u.p.w.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

m = A("m")
c = B("c")
k = C("k")
b = D("b")
a = E("a")
e = F("e")

m.v = k
m.t = k
m.z = b
c.u = a
k.p = c
k.w = m
k.z = e
b.x = c
b.w = e
b.z = k
b.t = k
b.q = k
b.v = m
a.p = k
e.y = m
e.u = b
e.r = c
e.z = k
assert k.p.u.p.w.t.p.txt == "c"