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

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

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

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

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

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

h = A("h")
n = B("n")
k = C("k")
i = D("i")
m = E("m")
d = F("d")
c = B("c")
l = F("l")
e = F("e")

h.t = i
h.v = k
h.z = c
h.u = m
n.t = d
n.o = m
n.y = c
n.w = c
n.q = k
k.w = h
k.t = h
k.y = h
k.x = d
i.u = m
i.o = m
i.q = c
i.z = e
m.x = k
m.u = k
m.p = c
d.z = e
c.t = d
c.o = m
c.y = n
c.w = n
c.q = k
l.z = d
e.z = d
assert d.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: C = None
        self.z: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
n = B("n")
k = C("k")
i = D("i")
m = E("m")
d = F("d")
c = B("c")
l = F("l")
e = F("e")

h.t = i
h.v = k
h.z = c
h.u = m
n.t = d
n.o = m
n.y = c
n.w = c
n.q = k
k.w = h
k.t = h
k.y = h
k.x = d
i.u = m
i.o = m
i.q = c
i.z = e
m.x = k
m.u = k
m.p = c
d.z = e
c.t = d
c.o = m
c.y = n
c.w = n
c.q = k
l.z = d
e.z = d
assert d.z.z.z.txt == "e"