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

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

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

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

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

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

b = A("b")
k = B("k")
a = C("a")
f = D("f")
e = E("e")
h = F("h")

b.y = h
k.z = f
k.o = f
k.t = f
k.q = h
k.s = h
k.v = b
a.v = f
a.w = f
f.v = k
f.w = k
f.u = e
e.u = k
h.x = f
assert k.z.v.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

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

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

b = A("b")
k = B("k")
a = C("a")
f = D("f")
e = E("e")
h = F("h")

b.y = h
k.z = f
k.o = f
k.t = f
k.q = h
k.s = h
k.v = b
a.v = f
a.w = f
f.v = k
f.w = k
f.u = e
e.u = k
h.x = f
assert k.z.v.t.u.txt == "e"