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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

h.s = n
h.z = n
h.x = d
h.r = l
h.q = l
h.o = m
m.t = d
m.x = d
m.q = d
m.z = h
m.u = a
m.w = c
n.u = h
a.o = l
l.z = n
e.t = l
e.p = h
d.t = l
d.p = h
c.u = h
assert m.u.o.z.txt == "n"