class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: C = None
        self.v: H = None
        self.w: C = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.z: E = None
        self.s: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.u: D = None
        self.t: A = None
        self.o: A = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.r: F = None
        self.u: E = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
c = C("c")
e = D("e")
d = E("d")
h = F("h")
j = G("j")
i = H("i")
f = C("f")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: C = None
        self.z: E = None
        self.s: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.u: D = None
        self.t: A = None
        self.o: A = None
        self.w: G = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.r: F = None
        self.u: E = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
c = C("c")
e = D("e")
d = E("d")
h = F("h")
j = G("j")
i = H("i")
f = C("f")
a = F("a")

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