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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

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

m = A("m")
k = B("k")
d = C("d")
c = D("c")
g = E("g")
h = F("h")
b = E("b")
j = C("j")
n = B("n")
a = D("a")

m.x = h
m.z = g
m.r = j
k.o = n
k.y = h
k.u = m
d.t = n
d.y = h
d.v = j
d.r = c
c.q = g
c.r = g
c.v = m
c.s = m
g.w = m
g.z = m
h.y = b
b.w = m
b.z = m
j.t = k
j.y = h
j.v = d
j.r = a
n.o = k
n.y = h
n.u = m
a.q = g
a.r = g
a.v = m
a.s = m
assert h.y.z.r.y.y.w.x.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.r: E = None
        self.s: A = None
        self.txt = txt

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

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

m = A("m")
k = B("k")
d = C("d")
c = D("c")
g = E("g")
h = F("h")
b = E("b")
j = C("j")
n = B("n")
a = D("a")

m.x = h
m.z = g
m.r = j
k.o = n
k.y = h
k.u = m
d.t = n
d.y = h
d.v = j
d.r = c
c.q = g
c.r = g
c.v = m
c.s = m
g.w = m
g.z = m
h.y = b
b.w = m
b.z = m
j.t = k
j.y = h
j.v = d
j.r = a
n.o = k
n.y = h
n.u = m
a.q = g
a.r = g
a.v = m
a.s = m
assert h.y.z.r.y.y.w.x.y.z.txt == "m"