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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.r: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: E = None
        self.r: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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