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

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

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

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

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

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

d = A("d")
k = B("k")
h = C("h")
g = D("g")
f = E("f")
l = F("l")

d.v = h
d.w = g
d.q = l
d.o = l
d.s = l
d.t = k
k.s = l
k.z = g
k.x = f
h.w = d
h.s = g
g.z = h
g.v = h
f.q = k
f.v = g
l.w = g
l.u = g
assert h.s.v.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.q: F = None
        self.t: B = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

d = A("d")
k = B("k")
h = C("h")
g = D("g")
f = E("f")
l = F("l")

d.v = h
d.w = g
d.q = l
d.o = l
d.s = l
d.t = k
k.s = l
k.z = g
k.x = f
h.w = d
h.s = g
g.z = h
g.v = h
f.q = k
f.v = g
l.w = g
l.u = g
assert h.s.v.w.t.txt == "k"