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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

e.z = a
e.y = a
e.q = k
e.t = f
a.y = n
i.v = e
i.y = f
i.r = a
i.u = k
k.u = b
k.r = h
k.z = a
n.t = a
b.u = n
b.q = a
f.v = e
f.y = i
f.r = a
f.u = k
h.u = b
h.r = k
h.z = a
assert h.z.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: D = None
        self.y: B = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

e.z = a
e.y = a
e.q = k
e.t = f
a.y = n
i.v = e
i.y = f
i.r = a
i.u = k
k.u = b
k.r = h
k.z = a
n.t = a
b.u = n
b.q = a
f.v = e
f.y = i
f.r = a
f.u = k
h.u = b
h.r = k
h.z = a
assert h.z.y.t.txt == "a"