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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.y: B = None
        self.x: A = None
        self.o: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: A = None
        self.y: B = None
        self.x: A = None
        self.o: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.o: C = None
        self.txt = txt

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

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