class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.o: D = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
n = C("n")
i = D("i")
m = E("m")
j = F("j")

h.u = i
h.y = i
h.o = i
h.z = m
h.t = n
f.p = n
f.z = h
f.v = j
n.q = j
n.o = j
n.z = i
n.r = i
n.y = m
n.w = f
i.x = n
i.p = f
i.u = h
m.v = n
m.s = f
m.p = f
m.q = j
m.o = h
j.y = i
j.u = i
assert f.z.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: D = None
        self.o: D = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: B = None
        self.u: A = None
        self.txt = txt

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

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

h = A("h")
f = B("f")
n = C("n")
i = D("i")
m = E("m")
j = F("j")

h.u = i
h.y = i
h.o = i
h.z = m
h.t = n
f.p = n
f.z = h
f.v = j
n.q = j
n.o = j
n.z = i
n.r = i
n.y = m
n.w = f
i.x = n
i.p = f
i.u = h
m.v = n
m.s = f
m.p = f
m.q = j
m.o = h
j.y = i
j.u = i
assert f.z.t.w.txt == "f"