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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: D = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.u: F = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.txt = txt

k = A("k")
e = B("e")
b = C("b")
n = D("n")
d = E("d")
g = F("g")
l = G("l")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.t: E = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: D = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: E = None
        self.u: F = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.txt = txt

k = A("k")
e = B("e")
b = C("b")
n = D("n")
d = E("d")
g = F("g")
l = G("l")
h = F("h")

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