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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

h = A("h")
j = B("j")
k = C("k")
e = D("e")
g = E("g")
d = F("d")

h.y = e
h.x = d
h.u = k
j.z = e
k.p = j
k.t = j
k.w = j
k.z = g
k.s = e
k.v = e
e.p = g
e.z = g
e.x = g
e.v = k
g.u = k
g.y = k
g.p = k
g.o = d
d.y = h
d.z = e
d.r = g
d.t = g
assert k.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.r: E = None
        self.t: E = None
        self.txt = txt

h = A("h")
j = B("j")
k = C("k")
e = D("e")
g = E("g")
d = F("d")

h.y = e
h.x = d
h.u = k
j.z = e
k.p = j
k.t = j
k.w = j
k.z = g
k.s = e
k.v = e
e.p = g
e.z = g
e.x = g
e.v = k
g.u = k
g.y = k
g.p = k
g.o = d
d.y = h
d.z = e
d.r = g
d.t = g
assert k.z.o.z.txt == "e"